Configure JMS queue in Mule flow. we are using ActiveMQ JMS implementation for this demo.
- Download ActiveMQ from http://activemq.apache.org/download.html
- Navigate to the path of activeMq
- start ActiveMq messging server by giving command as >activemq
- Configure ActiveMq to Anypoint studio
- Drag and drop JMS icon to canvas
- the properties as below. select the exchange pattern one-way or request-response based on requirement and provide queue name
- Provide queue name and click on + icon
- provide username and password as admin/admin
- Configuration complete
Demo-1: JMS as outbound endpoint.
send a request to mule flow where JMS queue configured as outbound endpoint
Import and execute the project, analyze the ActiveMQ console at
open the queues tab to see the queue details.
Demo-2 JMS as Inbound.
Design a flow that initiates from the JMS queue.
download and execute the project jmsreceiver.
Use ActiveMQ console to send the message to JMS queue. by clicking “Send” menu item on ActiveMQ home page
DB Insert Program:
Use Expression transformer to retrieve the fields from the payload. expression transformer will create new outbound endpoint properties. and populates them using Mule expression language.
Import the project DBInsertDemo to the Anypoint and run the flow
Test the flow with Postman or SOAPUI using the payload
<?xml version=”1.0″ encoding=”UTF-8″?>
makesure you selected mime type as application/xml while sending the request.
4) Analyze the Iterating the ResultSet and sending each record as JMS message in DBdemo project
The Demo projects available at Day-6.zip