Chapter 3. Using language support for Apache Camel extension


Important

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 for Red Hat Build of Apache Camel.

The Visual Studio Code language support extension adds the language support for Apache Camel for XML DSL and Java DSL code.

3.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.

3.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 CLI.
  • Create a Camel Quarkus project
  • Create a Camel on SpringBoot project
  • Specific Camel Catalog Version
  • Specific Runtime provider for the Camel Catalog

3.3. Requirements

Following points must be considered when using the Apache Camel Language Server:

  • Java 17 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:

  • 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, but from( "timer:timerName") and from(aVariable) do not work.

3.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

  1. Open the VS Code editor.
  2. In the VS Code editor, select View > Extensions.
  3. 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.

3.5. Using specific Camel catalog version

You can use the specific Camel catalog version. Click File > Preferences > Settings > Apache Camel Tooling > Camel catalog version. For Red Hat productized version that contains redhat in its version identifier, the Maven Red Hat repository is automatically added.

Note

For the first time a version is used, it takes several seconds/minutes to have it available depending on the time to download the dependencies in the background.

Limitations

  • The Kamelet catalog used is community supported version only. For the list of supported Kamelets, see link: Supported Kamelets
  • Modeline configuration is based on community only. Not all traits and modeline parameters are supported.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.