...
The Routing Slip from the EIP patterns allows you to route a message consecutively through a series of processing steps where the sequence of steps is not known at design time and can vary for each message.
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(); |
Messages will be checked for the existance of the "routingSlipHeader" header. The value of this header should be a comma-delimited list of endpoint URIs you wish the message to be routed to. The Message will be routed in a pipeline fashion (i.e. one after the other).
Configuration options
Here we set the header name and the URI delimiter to something different.
Using the Fluent Builders
Wiki Markup |
---|
{snippet:id=e3|lang=java|url=activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipTest.java} |
Using the Spring XML Extensions
Code Block |
---|
<camelContext id="buildRoutingSlip" xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="direct:c"/>
<routingSlip headerName="aRoutingSlipHeader" uriDelimiter="#"/>
</route>
</camelContext>
|
Further Examples
For further examples of this pattern in use you could look at the routing slip test cases.
Include Page | ||||
---|---|---|---|---|
|