Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: CAMEL-907

...

Code Block
xml
xml
    <from uri="seda:orders">
       <filter>
           <simple>in.header.foo</simple>
           <to uri="mock:fooOrders"/>
       </filter>
    </from>
{code:xml}

The Simple language can be used for the predicate test above in the filter, where we test if the in message has a {{foo}} header (a header with the key {{foo}} exists). If the expression evaluates to *true* then the message is routed to the {{mock:foo}} endpoint. And for *false* it is of course routed to {{mock:bar}} endpoint.

The same example in Java DSL:
{code:java}

The Simple language can be used for the predicate test above in the Message Filter pattern, where we test if the in message has a foo header (a header with the key foo exists). If the expression evaluates to true then the message is routed to the mock:foo endpoint, otherwise its lost in the deep blue sea (wink).

The same example in Java DSL:

Code Block
java
java
    from("seda:orders")
        .filter().simple("in.header.foo").to("seda:fooOrders");

...