Versions Compared

Key

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

...

Code Block
    from("direct:a").routingSlip(header("myHeader")).ignoreInvalidEndpoints();

...

Code Block
   <route>
       <from uri="direct:a"/>
       <routingSlip headerName="myHeader" ignoreInvalidEndpoints="true"/>
           <header>myHeader</header>
       </routingSlip>
   </route>

Then lets say the myHeader contains the following two endpoints direct:foo,xxx:bar. The first endpoint is valid and works. However the 2nd is invalid and will just be ignored. Camel logs at INFO level about, so you can see why the endpoint was invalid.

Expression supporting

Available as of Camel 2.4

The {Routing Slip] now supports to take the expression parameter as the Recipient List does. You can tell the camel the expression that you want to use to get the routing slip.

Code Block

    from("direct:a").routingSlip(header("myHeader")).ignoreInvalidEndpoints();

And in Spring XML its an attribute on the recipient list tag.

Code Block

   <route>
       <from uri="direct:a"/>
       <!--NOTE from Camel 2.4.0, you need to specify the expression element inside of the routingSlip element -->
       <routingSlip ignoreInvalidEndpoints="true">
           <header>myHeader</header>
       </routingSlip>
   </route>

Further Examples

For further examples of this pattern in use you could look at the routing slip test cases.

...