SlideShare a Scribd company logo
7/26/2017
Ankit Lawaniya 1
 Apache ActiveMQ is a popular open source messaging provider
which is easy to integrate with Mule. Mule soft provides the out of
the box support of ActiveMQ.
 In this tutorial we will see a basic example of ActiveMQ integration
with mule where we will be reading and writing messages from/to
the queue.
7/26/2017Ankit Lawaniya 2
 To write messages to the ActiveMQ we need a flow that has JMS
outbound endpoint at the end of the flow that writes the message to
queue.
 To read messages from ActiveMQ we need a flow that has JMS
inbound endpoint at the beginning of the flow that reads your
queue.
7/26/2017Ankit Lawaniya 3
We basically have two flows in this demo:
 Write Flow: HTTP Inbound endpoint receives Employee XML data
through the Http Request and forward it to the JMS queue.
 Read Flow: Reads the staged XMLs from the JMS queue and
processes the messages based on the department of Employees.
7/26/2017Ankit Lawaniya 4
Here’s an outline of the simple steps required to implement this
example:
 Create and Anypoint Studio project
 Import ActiveMQ libraries
 Create an ActiveMQ connector
 Enqueued the payload to JMS Queue
 Dequeued the payload from the JMS Queue
 Run the sample
7/26/2017Ankit Lawaniya 5
<jms:activemq-connector name="Active_MQ2" username="admin"
password="password" brokerURL="tcp://localhost:61616"
validateConnections="true" doc:name="Active MQ"/>
7/26/2017Ankit Lawaniya 6
<jms:inbound-endpoint queue="myqueue" connector-
ref="Active_MQ" doc:name="JMS">
<jms:transaction action="ALWAYS_BEGIN"/>
</jms:inbound-endpoint>
7/26/2017Ankit Lawaniya 7
<jms:outbound-endpoint queue="myqueue" connector-ref="Active_MQ"
doc:name="JMS"/>
Note: The above mentioned the minimum configuration that we have
used in the demo exercise , there are n number of attributes which can
be applied on the Inbound and outbound endpoint , to understand all of
the attributes please refer mulesoft site.
7/26/2017Ankit Lawaniya 8
Write Flow:
Create a new flow in Mule Studio and name it “writeFlow”. To configure
the project to use ActiveMQ libraries, right-click on the project ->
Properties -> Java Build Path -> Add External JARs. Select “activemq-
all-5.4.3.jar” from <ACTIVEMQ_HOME>.
Drag and drop the Http Listener to the source of the flow to receive the
incoming messages, Once Http Listener is in place drag and drop the
JMS Outbound endpoint at the end of the flow ,We will use the request
payload received from an HTTP inbound endpoint to seed the
ActiveMQ Queue.
7/26/2017Ankit Lawaniya 9
7/26/2017Ankit Lawaniya 10
Read Flow:
Create a new flow in Mule Studio and name it “readFlow”.Drag and
drop the JMS Inbound endpoint at the beginning of the flow to receive
the incoming messages, once message has been received in the flow
then we can start processing the payload.
7/26/2017Ankit Lawaniya 11
7/26/2017Ankit Lawaniya 12
7/26/2017Ankit Lawaniya 13
First, run ActiveMQ using executable “activemq” from
<ACTIVEMQ_HOME>/bin folder. Make sure you can access the
ActiveMQ admin page using http://localhost:8161/.
Open Rest Client and hit the URL with the payload on
http://localhost:8089/jms. This will enqueue the request to the ActiveMQ
JMS Queue “myqueue”.
7/26/2017Ankit Lawaniya 14
Verify this by examining the ActiveMQ administration page at
http://localhost:8161/admin/queues.jsp. We can see that there is 1
message under the “Messages Enqueued” column.
7/26/2017Ankit Lawaniya 15
7/26/2017
Ankit Lawaniya 16

More Related Content

What's hot (17)

PPTX
Quartz in Mule
Mohammed246
 
PPTX
Using maven with mule
Sindhu VL
 
PPTX
Mule esb How to convert from Json to Xml in 5 minutes
Gennaro Spagnoli
 
PPTX
Initialize database in Mule part2
Anirban Sen Chowdhary
 
PPTX
Scatter gather in mule
Khasim Cise
 
PPTX
Configuration patterns in mule
sathishmca143
 
PPTX
Sharing Resources - Mule
Anil Kumar V
 
PPTX
Mule esb - How to connect to a MySql Database in 5 minutes
Gennaro Spagnoli
 
ODP
Example mule
JavierMarRas
 
PPTX
Mule esb add logger to existing flow
Germano Barba
 
PPTX
Mulesoft Calling Flow of Other Applications
kumar gaurav
 
PPTX
Stored procedure in Mule
Khasim Saheb
 
PPTX
Mule message enricher
Anirban Sen Chowdhary
 
PPTX
Scatter and gather in mule
Rajkattamuri
 
PPTX
Mule with composite source
Anirban Sen Chowdhary
 
PDF
Async Scope With Mule ESB
Jitendra Bafna
 
PPTX
Mule quartz
Praneethchampion
 
Quartz in Mule
Mohammed246
 
Using maven with mule
Sindhu VL
 
Mule esb How to convert from Json to Xml in 5 minutes
Gennaro Spagnoli
 
Initialize database in Mule part2
Anirban Sen Chowdhary
 
Scatter gather in mule
Khasim Cise
 
Configuration patterns in mule
sathishmca143
 
Sharing Resources - Mule
Anil Kumar V
 
Mule esb - How to connect to a MySql Database in 5 minutes
Gennaro Spagnoli
 
Example mule
JavierMarRas
 
Mule esb add logger to existing flow
Germano Barba
 
Mulesoft Calling Flow of Other Applications
kumar gaurav
 
Stored procedure in Mule
Khasim Saheb
 
Mule message enricher
Anirban Sen Chowdhary
 
Scatter and gather in mule
Rajkattamuri
 
Mule with composite source
Anirban Sen Chowdhary
 
Async Scope With Mule ESB
Jitendra Bafna
 
Mule quartz
Praneethchampion
 

Similar to Active mq read and write flow in mule (20)

PPTX
Mule jms queues
Gandham38
 
PPTX
Jms queue
Son Nguyen
 
PPTX
M messaging 2
Vasanthii Chowdary
 
PPTX
Jms queues
Karnam Karthik
 
PPTX
Integration Of Mulesoft and Apache Active MQ
Gaurav Talwadker
 
PPTX
Mulesoft Basics and Connector Details
Arun Yaligar
 
PPTX
Filtering jms messages with mule
Anirban Sen Chowdhary
 
PPTX
Mulesoftconnectors
Manav Prasad
 
PPT
Simple http and jms for beginners
Christian Hipolito
 
PPTX
Mule JMS Transport
Rupesh Sinha
 
PPTX
Rabbit mq in mule
himajareddys
 
PPTX
Jms topics
Karnam Karthik
 
PPTX
Mule with rabbitmq
Rajkattamuri
 
PPTX
Mule rabbitmq
Praneethchampion
 
PPTX
Mule with rabbit mq
AbdulImrankhan7
 
PPTX
Mule with rabbit mq
mdfkhan625
 
PPTX
Mule with rabbit mq
Khan625
 
PPTX
Mule with rabbit mq
javeed_mhd
 
PPTX
Jms introduction
Son Nguyen
 
Mule jms queues
Gandham38
 
Jms queue
Son Nguyen
 
M messaging 2
Vasanthii Chowdary
 
Jms queues
Karnam Karthik
 
Integration Of Mulesoft and Apache Active MQ
Gaurav Talwadker
 
Mulesoft Basics and Connector Details
Arun Yaligar
 
Filtering jms messages with mule
Anirban Sen Chowdhary
 
Mulesoftconnectors
Manav Prasad
 
Simple http and jms for beginners
Christian Hipolito
 
Mule JMS Transport
Rupesh Sinha
 
Rabbit mq in mule
himajareddys
 
Jms topics
Karnam Karthik
 
Mule with rabbitmq
Rajkattamuri
 
Mule rabbitmq
Praneethchampion
 
Mule with rabbit mq
AbdulImrankhan7
 
Mule with rabbit mq
mdfkhan625
 
Mule with rabbit mq
Khan625
 
Mule with rabbit mq
javeed_mhd
 
Jms introduction
Son Nguyen
 
Ad

More from Ankit Lawaniya (12)

PPTX
Content based routing using mule choice flow control
Ankit Lawaniya
 
PPTX
Until successful scope in mule
Ankit Lawaniya
 
PPTX
First successful-router
Ankit Lawaniya
 
PPTX
Iterative processing using the for each scope in
Ankit Lawaniya
 
PPTX
Improving performance with cache scope in mule
Ankit Lawaniya
 
PPTX
Cors (cross origin request sharing) in mule
Ankit Lawaniya
 
PPTX
Content enrichment using mule message enricher
Ankit Lawaniya
 
PPTX
Validation module in mule
Ankit Lawaniya
 
PPTX
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
PPTX
Validate json schema component
Ankit Lawaniya
 
PPTX
Parse template transformer mule
Ankit Lawaniya
 
PPTX
Composite source in mule
Ankit Lawaniya
 
Content based routing using mule choice flow control
Ankit Lawaniya
 
Until successful scope in mule
Ankit Lawaniya
 
First successful-router
Ankit Lawaniya
 
Iterative processing using the for each scope in
Ankit Lawaniya
 
Improving performance with cache scope in mule
Ankit Lawaniya
 
Cors (cross origin request sharing) in mule
Ankit Lawaniya
 
Content enrichment using mule message enricher
Ankit Lawaniya
 
Validation module in mule
Ankit Lawaniya
 
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
Validate json schema component
Ankit Lawaniya
 
Parse template transformer mule
Ankit Lawaniya
 
Composite source in mule
Ankit Lawaniya
 
Ad

Recently uploaded (20)

PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
July Patch Tuesday
Ivanti
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
July Patch Tuesday
Ivanti
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 

Active mq read and write flow in mule

  • 2.  Apache ActiveMQ is a popular open source messaging provider which is easy to integrate with Mule. Mule soft provides the out of the box support of ActiveMQ.  In this tutorial we will see a basic example of ActiveMQ integration with mule where we will be reading and writing messages from/to the queue. 7/26/2017Ankit Lawaniya 2
  • 3.  To write messages to the ActiveMQ we need a flow that has JMS outbound endpoint at the end of the flow that writes the message to queue.  To read messages from ActiveMQ we need a flow that has JMS inbound endpoint at the beginning of the flow that reads your queue. 7/26/2017Ankit Lawaniya 3
  • 4. We basically have two flows in this demo:  Write Flow: HTTP Inbound endpoint receives Employee XML data through the Http Request and forward it to the JMS queue.  Read Flow: Reads the staged XMLs from the JMS queue and processes the messages based on the department of Employees. 7/26/2017Ankit Lawaniya 4
  • 5. Here’s an outline of the simple steps required to implement this example:  Create and Anypoint Studio project  Import ActiveMQ libraries  Create an ActiveMQ connector  Enqueued the payload to JMS Queue  Dequeued the payload from the JMS Queue  Run the sample 7/26/2017Ankit Lawaniya 5
  • 6. <jms:activemq-connector name="Active_MQ2" username="admin" password="password" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"/> 7/26/2017Ankit Lawaniya 6
  • 7. <jms:inbound-endpoint queue="myqueue" connector- ref="Active_MQ" doc:name="JMS"> <jms:transaction action="ALWAYS_BEGIN"/> </jms:inbound-endpoint> 7/26/2017Ankit Lawaniya 7
  • 8. <jms:outbound-endpoint queue="myqueue" connector-ref="Active_MQ" doc:name="JMS"/> Note: The above mentioned the minimum configuration that we have used in the demo exercise , there are n number of attributes which can be applied on the Inbound and outbound endpoint , to understand all of the attributes please refer mulesoft site. 7/26/2017Ankit Lawaniya 8
  • 9. Write Flow: Create a new flow in Mule Studio and name it “writeFlow”. To configure the project to use ActiveMQ libraries, right-click on the project -> Properties -> Java Build Path -> Add External JARs. Select “activemq- all-5.4.3.jar” from <ACTIVEMQ_HOME>. Drag and drop the Http Listener to the source of the flow to receive the incoming messages, Once Http Listener is in place drag and drop the JMS Outbound endpoint at the end of the flow ,We will use the request payload received from an HTTP inbound endpoint to seed the ActiveMQ Queue. 7/26/2017Ankit Lawaniya 9
  • 11. Read Flow: Create a new flow in Mule Studio and name it “readFlow”.Drag and drop the JMS Inbound endpoint at the beginning of the flow to receive the incoming messages, once message has been received in the flow then we can start processing the payload. 7/26/2017Ankit Lawaniya 11
  • 14. First, run ActiveMQ using executable “activemq” from <ACTIVEMQ_HOME>/bin folder. Make sure you can access the ActiveMQ admin page using http://localhost:8161/. Open Rest Client and hit the URL with the payload on http://localhost:8089/jms. This will enqueue the request to the ActiveMQ JMS Queue “myqueue”. 7/26/2017Ankit Lawaniya 14
  • 15. Verify this by examining the ActiveMQ administration page at http://localhost:8161/admin/queues.jsp. We can see that there is 1 message under the “Messages Enqueued” column. 7/26/2017Ankit Lawaniya 15