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.
from("jms:queue:order:in").pipeline("direct:transformOrder", "direct:validateOrder", "jms:queue:order:process");
Java DSL Example:
from("jms:queue:order:in").to("direct:transformOrder",
"direct:validateOrder", "jms:queue:order:process");
from("jms:queue:order:in")
.to("direct:transformOrder")
.to("direct:validateOrder")
.to("jms:queue:order:process");