Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
{div:class=confluenceTableSmall}
|| Name || Default Value || Description ||
| {{uriDelimiter}} | {{,}} | Delimiter used if the [Expression] returned multiple endpoints. |
| {{ignoreInvalidEndpoints}} | {{false}} | If an endpoint uri could not be resolved, should it be ignored. Otherwise Camel will throw an exception stating the endpoint uri is not valid. |
| {{cacheSize}} | 1000 | *Camel 2.13.1/2.12.4:* Allows to configure the cache size for the ProducerCache which caches producers for reuse in the routing slip. Will by default use the default cache size which is 1000. Setting the value to -1 allows to turn off the cache all together. |
{div}

Example

The following route will take any messages sent to the Apache ActiveMQ queue SomeQueue and pass them into the Routing Slip pattern.

Code Block

from("activemq:SomeQueue").routingSlip("aRoutingSlipHeader");

...

Using the Spring XML Extensions

Code Block

<camelContext id="buildRoutingSlip" xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="direct:c"/>
    <routingSlip uriDelimiter="#">
       <header>aRoutingSlipHeader</header>
    </routingSlip>
  </route>
</camelContext>

...

The Routing Slip now supports ignoreInvalidEndpoints which the Recipient List also supports. You can use it to skip endpoints which are invalid.

Code Block

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

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

Code Block

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

...

The Routing Slip now supports to take the expression parameter as the Recipient List does. You can tell 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>

...

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

Include Page
Using This Pattern
Using This Pattern