Creating a new Apache Camel XML file

Revision History

Overview

Apache Camel stores routes in an XML file that contains a camelContext element. Fuse IDE includes a wizard that simplifies adding an Apache Camel context file to your project.

Procedure

To add an Apache Camel context file to your project:

  1. In Package Explorer, select any item in your routing project.

  2. Right-click it to open the context menu.

  3. Select New > Camel XML File to open the Camel XML File wizard, as shown in Figure 6, “Camel XML File wizard”.

    Figure 6. Camel XML File wizard

    Camel XML file wizard

    [Tip]Tip

    Alternatively, you can open the wizard by selecting, from the menu bar, File > New > Camel XML File.

  4. In RouteContainer, accept the default location or enter another location for the new context file. The default location is the folder you selected in Step 2.

    [Tip]Tip

    You can click Browse... button to search for an appropriate location.

    [Note]Note

    If you're using Spring, place the new context file in projectName /src/main/resources/META-INF/spring/.

  5. In File Name, enter a name for the new context file.

    The file's name cannot contain spaces or special characters, and it must be unique within the JVM.

  6. In Framework, select the framework the routes will use:

    • Spring—for routes that will be deployed in Spring containers, standalone, or non-OSGi containers

    • OSGi Blueprint—for routes that will be deployed in OSGi containers

    • Routes—for creating routes that you can load and add into an existing camelContext

  7. Click Finish.

    The new context file is added to the project in Package Explorer and opened in the route editor.

Related topics

New Camel XML File