Day-6 JMS and DB Insert

Configure JMS queue in Mule flow. we are using ActiveMQ JMS implementation for this demo.

  • Download  ActiveMQ from
  • Navigate to the path of activeMq
  • C:\xxxxx\apache-activemq-5.14.2-bin\apache-activemq-5.14.2\bin\win64
  • start ActiveMq messging server by giving command as >activemq
  • Configure ActiveMq to Anypoint studio
  • Drag and drop JMS icon to canvas
  • JMS
  • the properties as below. select the exchange pattern one-way or request-response based on requirement and provide queue namejms-2
  • Provide queue name and click on + icon
  • jms-3
  • 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 projectDB-Iterate

The Demo projects available at

2 thoughts on “Day-6 JMS and DB Insert

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s