Reputation: 340
Can I split list of my object? Like this Camel- Split List<MyObj> and process each java object - XML Config but, for header.
Upvotes: 5
Views: 6057
Reputation: 7636
Yes, you can:
from("direct:start")
.split(simple("header.myHeader"))
.log("Split: ${body}");
Tested with:
final ProducerTemplate template = context.createProducerTemplate();
template.sendBodyAndHeader("direct:start", "World!", "myHeader", Arrays.asList("a", "b", "c"));
Log:
INFO Split: a
INFO Split: b
INFO Split: c
Upvotes: 11