O'Reilly logo

Mastering Apache Camel by Jean-Baptiste Onofré

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required