A complete example

We have a bundle with the following route using the Blueprint DSL:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

      <camelContext xmlns="http://camel.apache.org/schema/blueprint">
          <route id="test">
              <from uri="direct:input"/>
              <onException>
                  <exception>java.lang.Exception</exception>
                  <redeliveryPolicy maximumRedeliveries="2"/>
                  <handled>
                      <constant>true</constant>
                  </handled>
                  <to uri="direct:error"/>
              </onException>
              <choice>
                  <when>
                      <xpath>//country='France'</xpath>
                      <to uri="direct:france"/>
                  </when>
                  <when>
                      <xpath>//country='USA'</xpath>
                      <to uri="direct:usa"/>
                  </when>
                  <otherwise>
                      <to uri="direct:other"/>
                  </otherwise>
              </choice>
          </route>
      </camelContext>

</blueprint>

As usual, this route ...

Get Mastering Apache Camel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.