Chapter 1. Using language support for Apache Camel extension
The VS Code extensions for Apache Camel are listed as development support. For more information about scope of development support, see Development Support Scope of Coverage
The Visual Studio Code language support extension adds the language support for Apache Camel for XML DSL and Java DSL code.
1.1. About language support for Apache Camel extension
This extension provides completion, validation and documentation features for Apache Camel URI elements directly in your Visual Studio Code editor. It works as a client using the Microsoft Language Server Protocol which communicates with Camel Language Server to provide all functionalities.
1.2. Features of language support for Apache Camel extension
The important features of the language support extension are listed below:
- Language service support for Apache Camel URIs.
- Quick reference documentation when you hover the cursor over a Camel component.
- Diagnostics for Camel URIs.
- Navigation for Java and XML langauges.
- Creating a Camel Route specified with Yaml DSL using Camel JBang.
1.3. Requirements
Following points must be considered when using the Apache Camel Language Server:
-
Java 11 is currently required to launch the Apache Camel Language Server. The
java.home
VS Code option is used to use a different version of JDK than the default one installed on the machine. - For some features, JBang must be available on a system command line.
For an XML DSL files:
-
Use an
.xml
file extension. - Specify the Camel namespace, for reference, see http://camel.apache.org/schema/blueprint or http://camel.apache.org/schema/spring.
-
Use an
For a Java DSL files:
-
Use a
.java
file extension. -
Specify the Camel package(usually from an imported package), for example,
import org.apache.camel.builder.RouteBuilder
. -
To reference the Camel component, use from or to and a string without a space. The string cannot be a variable. For example,
from("timer:timerName")
works, butfrom( "timer:timerName")
andfrom(aVariable)
do not work.
-
Use a
1.4. Installing Language support for Apache Camel extension
You can download the Language support for Apache Camel extension from the VS Code Extension Marketplace and the Open VSX Registry. You can also install the Language Support for Apache Camel extension directly in the Microsoft VS Code.
Procedure
- Open the VS Code editor.
- In the VS Code editor, select View > Extensions.
- In the search bar, type Camel. Select the Language Support for Apache Camel option from the search results and then click Install.
This installs the language support extension in your editor.
Additional resources