Search code examples
mulemule-componentmule-connector

How to send Multiple message to JMS Endpoint in Mule


In Mule, I have a requirement to split the request XML data and construct Multiple mule messages and post them to a JMS queue.

I have managed to split the message and have a list of Mule Message in my Java component. My question is, how do I pass the list of mule message to a JMS endpoint as individual message?


Solution

  • I would suggest using a foreach component. You can change the collection in case you save it to a flowVar.

    <foreach doc:name="For Each" collection="#[payload]">
        <jms:outbound-endpoint doc:name="JMS" connector-ref="JMS" queue="myQueue"/>
    </foreach>