I use Spring+Camel and Java application and I can't understand how to use Loop in Camel config. Camel doc suggests:
<route>
<from uri="direct:b"/>
<loop>
<header>loop</header>
<to uri="mock:result"/>
</loop>
</route>
How to adjust loop for my case?
<route>
<from uri="myjms:queue:{{myqueue.name1}}"/>
...
<method bean="myProcessor" method="getSomeMyObjects"> <!-- returns Collection<MyObject> -->
<loop>
<header>?????</header> <!-- get single MyObject?.. how???.. -->
<to uri="myjms:queue:{{myqueue.name2}}"/>
</loop>
</rout>
Inside bean:
<bean id="myProcessor" class="my.package.MyProcessor">
I've implemented the following methods:
getSomeMyObjects() - returns Collection<MyObject>;
getSomeMyObject(int index) - returns single MyObject;
getSomeMyObjectsCount() - returns the number of objects inside Collection<MyObject>;
and can implement any other methods if necessary.
Is it possible to solve this using loop in Camel config?