The most basic route will take its input from just one endpoint, using the from
syntax in the DSL. But, what if we needed to identify multiple inputs for your route? For those situations, there are several alternatives for specifying multiple inputs to a route. The approach taken will depend on whether we need the exchanges to be processed completely independently of one other or if we want the exchanges from different inputs to be combined together in some fashion.
Multiple Independent Inputs
The simplest way to specify multiple inputs is using the multi-argument form of the from()
DSL command:
from("URI1", "URI2", "URI3").to("DestinationUri");
<route> <from uri="URI1" /> <!-- INPUT --> <from uri="URI2" /> <!-- INPUT --> <from uri="URI3" /> <!-- INPUT --> <to uri="DestinationUri" /> <!-- OUTPUT --> </route>
NOTE: Exchanges from each of the input endpoints, URI1, URI2, and URI3, are processed independently of each other and in separate threads