Have you tried first using splitter, and then using a choice to determine
the route? From the example in "Composed Message Processor", they do
something similar:
// split up the order so individual OrderItems can be validated by the
appropriate bean
from("direct:start")
.split().body()
.choice()
.when().method("orderItemHelper", "isWidget")
.to("bean:widgetInventory")
.otherwise()
.to("bean:gadgetInventory")
.end()
.to("seda:aggregate");
// collect and re-assemble the validated OrderItems into an order again
from("seda:aggregate")
.aggregate(new
MyOrderAggregationStrategy()).header("orderId").completionTimeout(1000L)
.to("mock:result");
Of course, your "when" calls will be different to look at the key values.
On Mon, Oct 24, 2016 at 5:03 AM, [email protected] <
[email protected]> wrote:
> I've gone through the document of recipient list and seems it send the same
> copy of the message to all routes.
>
> I'm looking for sending each value of the map to a different router based
> on
> the key.
>
> Thank you.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Dynamic-routing-based-on-collection-values-tp5789157p5789165.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>