4. Let me introduce you a component in Mule called Mule
Requester
Mule Requester
This component we can place in between our Mule
flow and can be used for any Inbound component
like Http, JMS or File
5. It can :-
• Load a file in a middle of a flow and start processing it.
• call a JMS queue and fetch the data from it in middle of
a queue
• Pull messages from a mail server on demand
6. Let us consider we need to fetch some messages from a JMS
queue in the middle of the flow
So whenever a http url is hit on the server the Mule
requester will be active and fetch the data from the JMS
queue
7. Now suppose there is a JMS queue named input from
where we need to fetch data in our flow on we hit the url
: http://localhost:8081/fetch like the following :-
As you can see above I am able to fetch the data “My
Payload” from the JMS queue in the middle of the flow
8. The Mule config will be :-
<mulerequester:config name="Mule_Requester" doc:name="Mule
Requester"/>
<jms:activemq-connector name="Active_MQ"
brokerURL="tcp://localhost:61616" specification="1.1"
doc:name="Active MQ"/>
<flow name="QueueRequester" doc:name="QueueRequester">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8081" path="fetch" doc:name="HTTP"/>
<mulerequester:request config-ref="Mule_Requester"
resource="jms://input" doc:name="Request a message from a queue"
/>
<logger message="Payload from JMS message: #[payload]"
level="WARN" doc:name="Logger"/>
</flow>
9. Thus, with the help of Mule Requester we can call any inbound
endpoint in Mule in between the Mule flow starting from JMS, to
http inbound and even File inbound