In some scenarios, a single event may often trigger an entire sequence of processing steps. In these situations, we use Pipes and Filters to divide much larger processing steps (filter) that are connected by a series of channels (pipes).
In the following example, “jms” will represent the JMS component used for consuming JMS messages on a JMS broker. The term “direct” is used to combine our endpoints in a synchronous fashion. This format will allow us to divide our routes into sub-routes for potential reusability.
XML DSL Example
<route>
<from uri="jms:queue:order:in"/>
<pipeline>
<to uri="direct:transformOrder"/>
<to uri="direct:validateOrder"/>
<to uri="jms:queue:order:process"/>
</pipeline>
</route>
<route>
<from uri="jms:queue:order:in"/>
<to uri="direct:transformOrder"/>
<to uri="direct:validateOrder"/>
<to uri="jms:queue:order:process"/>
</route>