<setHeader headerName="smsRecivers"><simple>{{reciversList}}</simple></setHeader>
I have a list mobile numbers(in comma separated form reciversList=999999999,88888888,799999999 ) and I have to send each a sms, looping through reciversList list
some thing like
<loop on="reciversList">
// so some work
</loop>
I looked in to loop function it have a constant number.
You can use loop : http://camel.apache.org/loop.html
<route>
<setHeader headerName="smsRecivers">
<simple>{{reciversList}}</simple>
</setHeader>
<loop>
<simple>${in.header.smsRecivers.size}</simple>
.....
</loop>
</route>
Inside loop body you can get list's item by index, using excange property CamelLoopIndex or you can use custom increment index ( which can calculate in other header ).
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