Chapter 5. Creating a New Camel XML file
Overview
Apache Camel stores routes in an XML file that contains a camelContext element. The tooling includes a wizard that simplifies adding an Apache Camel context file to your project. It creates a new XML file that has all of the required namespaces preconfigured and a template camelContext element.
Procedure
To add a new Apache Camel context file to your project:
Select → → → → from the main menu to open the Camel XML File wizard, as shown in Figure 5.1, “Camel XML File wizard”.
Figure 5.1. Camel XML File wizard

In RouteContainer, enter the location for the new file, or accept the default.
You can click
to search for an appropriate location.
ImportantThe Spring framework and the OSGi Blueprint framework require that all Apache Camel files be placed in specific locations under the project’s
META-INForOSGI-INFfolder:-
Spring -
projectName/src/main/resources/META-INF/spring/ -
OSGi Blueprint -
projectName/src/main/resources/OSGI-INF/blueprint/
-
Spring -
In File Name, enter a name for the new context file, or accept the default (
camelContext.xml).The file’s name cannot contain spaces or special characters, and it must be unique within the JVM.
In Framework, accept the default, or select which framework the routes will use:
- Spring — [default] for routes that will be deployed in Spring containers, non-OSGi containers, or as standalone applications
- OSGi Blueprint — for routes that will be deployed in OSGi containers
-
Routes — for routes that you can load and add into existing
camelContexts
Click .
The new context file is added to the project and opened in the route editor.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.