SlideShare a Scribd company logo
ACCESSING JMS BY GROOVY
We have earlier seen how to integrate Mule and ActiveMQ .
We have also seen how to send message to ActiveMQ queue from Mule with a specific
JMS priority and to fetch messages from ActiveMQ queue filtering a particular JMS
Here we will see how to filter messages to ActiveMQ from Groovy script with a particular
JMS priority
Yes, we can filter payload using Groovy script for the message from ActiveMQ queue with a
particular JMS priority ….
Let’s consider we have a simple Mule flow as following:-
Here in we will send messages to an ActiveMQ queue with a particular JMS priority.
Let’s say our queue name be StudioOUT.
So we will be sending messages to queue StudioOUT.
So, our Mule config will be as following:-
You can see we are sending message to queue StudioOUT with JMS priority 9 using the
following code :-
<message-properties-transformer>
<add-message-property key="Priority" value="9"/>
</message-properties-transformer>
Now, we will test the flow by hitting url http://localhost:8081/test the message will be send
to queue with JMS priority 9 :-
And, we will also check our ActiveMQ portal we will find the following :-
You can see the message priority is 9 as we have configured JMS priority in our flow
Now let’s design a flow which will receive message from ActiveMQ queue and filter it by
JMS priority using Groovy script:-
You can see we have used Groovy Script to fetch the message from queue StudioOUT
Now our Mule config which is using Groovy script is as follow:-
Now if we start our application again we will get as follow:-
And you can see it has consumed the message from queue which has the JMS priority 9 :-
Thus, you can see that we can also set the filter to consume message from ActiveMQ using
Groovy
In my next slide I will bring some other techniques in Mule implementation .
Hope you have enjoyed this simpler version.
Keep sharing your knowledge and let our Mule community grow 

More Related Content

PPTX
Create dynamic json using mule
PPTX
PPTX
Power Mta 4.0
PPTX
Mulesoft Using Groovy Component
PPTX
power mta
PPTX
Activemq installation and master slave setup using shared broker data
PPTX
Mule SOAP Router
PDF
testing1
Create dynamic json using mule
Power Mta 4.0
Mulesoft Using Groovy Component
power mta
Activemq installation and master slave setup using shared broker data
Mule SOAP Router
testing1

Viewers also liked (9)

PPTX
Adding dynamic file
PPTX
Xml transform
PPTX
Introduction java messaging services
PPTX
Using map and list starter
PPT
Finance connectors with mule
PPTX
Multi database access
PPTX
Request in mule
PPTX
Expression language in mule
PPTX
Using groovy in mule
Adding dynamic file
Xml transform
Introduction java messaging services
Using map and list starter
Finance connectors with mule
Multi database access
Request in mule
Expression language in mule
Using groovy in mule
Ad

Similar to Accessing jms by groovy (20)

PPTX
Accessing jms in mule using groovy
PPTX
Accessing jms in mule using groovy
PPTX
Accessing jms in mule using groovy
PPTX
Filtering jms messages with mule
PPTX
Running mule from java
PPT
Simple http and jms for beginners
PPTX
Mule with stored procedure
PPTX
Stored procedure in Mule
PPTX
Mule stored procedure
PPTX
Mule with stored procedure
PPTX
Deploying and running in mule standalone
PPTX
Deploying and Running in Mule
PPTX
Deploying and running in mule standalone
PPTX
Deploying and running in mule standalone
PPTX
Stored procedure in mule
PPTX
Mule with stored procedure
PPTX
Deploying and running mule standalone
PPTX
Jms queues
PPTX
Community edition Cache
PPTX
Cache for community edition
Accessing jms in mule using groovy
Accessing jms in mule using groovy
Accessing jms in mule using groovy
Filtering jms messages with mule
Running mule from java
Simple http and jms for beginners
Mule with stored procedure
Stored procedure in Mule
Mule stored procedure
Mule with stored procedure
Deploying and running in mule standalone
Deploying and Running in Mule
Deploying and running in mule standalone
Deploying and running in mule standalone
Stored procedure in mule
Mule with stored procedure
Deploying and running mule standalone
Jms queues
Community edition Cache
Cache for community edition
Ad

More from Son Nguyen (20)

PPTX
Wsdl connector introduction
PPTX
Android intergrate with mule
PPTX
Mule flow overview
PPTX
Mule flow and filter
PPTX
Handle exceptions in mule
PPT
Spring security integrate with mule
PPTX
Message processor in mule
PPTX
Mule with data weave
PPTX
Using spring scheduler mule
PPTX
Composite source in bound and out-bound
PPT
Batch job processing
PPTX
Using message enricher
PPT
Google drive connection
PPTX
Using properties in mule
PPT
Mule integrate with microsoft
PPTX
Jms queue
PPT
Anypoint connectors
PPTX
Mule esb basic introduction
PPTX
Runing batch job in mule
PPT
Mule integration with cloud hub
Wsdl connector introduction
Android intergrate with mule
Mule flow overview
Mule flow and filter
Handle exceptions in mule
Spring security integrate with mule
Message processor in mule
Mule with data weave
Using spring scheduler mule
Composite source in bound and out-bound
Batch job processing
Using message enricher
Google drive connection
Using properties in mule
Mule integrate with microsoft
Jms queue
Anypoint connectors
Mule esb basic introduction
Runing batch job in mule
Mule integration with cloud hub

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
MIND Revenue Release Quarter 2 2025 Press Release
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Electronic commerce courselecture one. Pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx

Accessing jms by groovy

  • 2. We have earlier seen how to integrate Mule and ActiveMQ . We have also seen how to send message to ActiveMQ queue from Mule with a specific JMS priority and to fetch messages from ActiveMQ queue filtering a particular JMS Here we will see how to filter messages to ActiveMQ from Groovy script with a particular JMS priority
  • 3. Yes, we can filter payload using Groovy script for the message from ActiveMQ queue with a particular JMS priority ….
  • 4. Let’s consider we have a simple Mule flow as following:- Here in we will send messages to an ActiveMQ queue with a particular JMS priority. Let’s say our queue name be StudioOUT. So we will be sending messages to queue StudioOUT.
  • 5. So, our Mule config will be as following:- You can see we are sending message to queue StudioOUT with JMS priority 9 using the following code :- <message-properties-transformer> <add-message-property key="Priority" value="9"/> </message-properties-transformer>
  • 6. Now, we will test the flow by hitting url http://localhost:8081/test the message will be send to queue with JMS priority 9 :-
  • 7. And, we will also check our ActiveMQ portal we will find the following :- You can see the message priority is 9 as we have configured JMS priority in our flow
  • 8. Now let’s design a flow which will receive message from ActiveMQ queue and filter it by JMS priority using Groovy script:- You can see we have used Groovy Script to fetch the message from queue StudioOUT
  • 9. Now our Mule config which is using Groovy script is as follow:-
  • 10. Now if we start our application again we will get as follow:-
  • 11. And you can see it has consumed the message from queue which has the JMS priority 9 :- Thus, you can see that we can also set the filter to consume message from ActiveMQ using Groovy
  • 12. In my next slide I will bring some other techniques in Mule implementation . Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow 