XML Io Dsl

Since Camel 3.9

The xml-io-dsl component is the Camel optimized XML DSL with a fast and low overhead XML parser. The classic XML DSL loads using JAXB with high overhead.

You can use the generic JAXB parser for parsing any XML. However, the xml-io-dsl is a source code generated parser that is Camel specific and can only parse Camel .xml route files (not classic Spring <beans> XML files).

If you are using Camel XML DSL, you can use xml-io-dsl which has lower overhead than xml-jaxb-dsl component. You can use this component in all of Camel’s runtimes, such as Spring Boot, Quarkus, Camel Main, and Camel-K.

Example

The following my-route.xml source file:

my-route.xml
<routes xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="timer:tick"/>
        <setBody>
            <constant>Hello Camel K!</constant>
         </setBody>
        <to uri="log:info"/>
    </route>
</routes>
You can omit the xmlns namespace. If there is only a single route, you can use <route> as the root XML tag.

You can then load and run this route definition with Camel CLI or Camel K.

Running with Camel K
kamel run my-route.xml
Running with Camel CLI
camel run my-route.xml

See Also

See DSL