Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Content Based Router

The Content Based Router from the EIP patterns allows you to route messages to the correct destination based on the contents of the message exchanges.

The following example shows how to route a request from an input seda:a endpoint to either seda:b, seda:c or seda:d depending on the evaluation of various Predicate expressions

Using the Fluent Builders


Code Block
RouteBuilder builder = new RouteBuilder() {
    public void configure() {

See Why can I not use when or otherwise in a Java Camel route if you have problems with the Java DSL, accepting using when or otherwise.

Using the Spring XML Extensions


Code Block
<camelContext errorHandlerRef="errorHandler" xmlns="">
        <from uri="direct:a"/>
                <xpath>$foo = 'bar'</xpath>
                <to uri="direct:b"/>
                <xpath>$foo = 'cheese'</xpath>
                <to uri="direct:c"/>
                <to uri="direct:d"/>

For further examples of this pattern in use you could look at the junit test case

Include Page
Using This Pattern
Using This Pattern