I am facing a minor issue using Mule requester .. I have the following Mule flow :-
<!-- This flow sends payload to ActiveMQ -->
<flow name="SendPayloadToActiveMQ" doc:name="mulerequesterdemoFlow1">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8088/requester" doc:name="HTTP"/>
<set-payload value="My Payload" doc:name="Set Payload"/>
<jms:outbound-endpoint doc:name="JMS" queue="input" connector-ref="Active_MQ"/>
</flow>
<!-- This flow consumes 3 payload from ActiveMQ -->
<flow name="CountRequester" doc:name="CountRequester">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" path="request3messages"/>
<mulerequester:request-collection config-ref="Mule_Requester" resource="jms://input" doc:name="Mule Requester" count="3"/>
<logger level="INFO" doc:name="Logger" message="Payload: #[payload]"/>
</flow>
Now as you can see the first flow SendPayloadToActiveMQ will send payload to the JMS queue input queue and the second flow CountRequester will consume only 3 messages from JMS input queue ..
But now the issue is if there are 6 messages in the input queue, then the second flow is consuming all the 6 messages from the queue and the queue is left blank ..
I can even see it in the logger that all the six messages are consumed Payload: org.mule.api.processor.LoggerMessageProcessor:
Payload: [My Payload, My Payload, My Payload, My Payload, My Payload, My Payload]
But it was suppose to consume only 3 messages as I configured
<mulerequester:request-collection config-ref="Mule_Requester" resource="jms://input" doc:name="Mule Requester" count="3"/>
that was supposed to consume only 3 messages ....
Please help .. am I doing any thing wrong here ?