I've a list of subscriber which i'm getting from a java component in mule flow and for each subscriber i've queue in which i want to publish the payload. Payload is same for all subscriber. I'm looking at two option -
1. ForEach 2. Collection Splitter
which one fits in this scenario and how to achieve this ?
0
votes
2 Answers
0
votes
For the scenario you have specified both the processors of Mule should do the job.
I would suggest you go with collection-splitter as you just need to post each item onto a queue.
Try the following approach
<flow name="sampleFlow">
.... some inbound endpoint....
.... some message processors ....
<component > ... component generating the collections as output payload ...
<collection-splitter enableCorrelation="IF_NOT_SET"></collection-splitter>
<jms:outbound-endpoint queue="subscriber.queue.name" connector-ref="jmsconnector" exchange-pattern="one-way" />
</flow>
Hope this helps.