Can I split list of my object? Like this Camel- Split List<MyObj> and process each java object - XML Config but, for header.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With