SlideShare a Scribd company logo
1 of 13
JMS QUEUE
JMS
• JMS (Java Message Service) is a widely-used API for Message
Oriented Middleware. It allows communication between
different components of a distributed application to be loosely
coupled, reliable, and asynchronous.
• JMS supports two models for messaging:
• Queues - Point-to-point
• Topics - Publish and subscribe
• Mule's JMS transport lets you easily send and receive
messages to queues and topics for any message service which
implements the JMS specification.
QUEUES
• In the point-to-point or queuing model, a sender posts
messages to a particular queue and a receiver reads messages
from the queue. Here, the sender knows the destination of the
message and posts the message directly to the receiver's
queue. It is characterized by the following:
• Only one consumer gets the message
• The producer does not have to be running at the time
the consumer consumes
the message, nor does the consumer need to be running
at the time the message is sent
• Every message successfully processed is
acknowledged by the consumer
Configuration with Example:
• Anypoint Studio offers easy-to-use components to connect to
JMS Queues and Topics. In the below example, we will use
ActiveMQ, a leading open source JMS implementation from
Apache that supports JMS.
• The outline of the simple steps required to implement this
example is as follows:
• Import ActiveMQ libraries
• Create an ActiveMQ connector
• Enqueue to JMS Queue
• Run the sample
1. Import ActiveMQ Library:
• Download Apache ActiveMQ binaries (ActiveMQ 5.11) from
http://activemq.apache.org/download.html. Unzip the
compressed file to any folder on your file system. Let’s call
it <ACTIVEMQ_HOME>.
• Create a new flow in Mule Studio and name it “jms”. To
configure the project to use ActiveMQ libraries, right-click
on the project -> Properties -> Java Build Path -> Add
External JARs. Select “activemq-all-5.11-SNAPSHOT.jar”
from <ACTIVEMQ_HOME>.
2. Create an ActiveMQ Connector:
• Double-click on “jms” flow to bring up the message flow. Click
on the “Global Elements” tab. Click on “Create” and locate
ActiveMQ under “Connectors -> JMS” and click OK.
3. Enqueue to JMS Queue:
• We will use the request payload received from an HTTP
inbound endpoint to seed the ActiveMQ Queue. Open the
“jms” message flow and drag and drop an HTTP endpoint on
to the flow.
• Double-click on the HTTP endpoint to bring up the
properties dialog. Specify “jms_queue” for Path. This will
make the HTTP endpoint accessible using URL
http://localhost:7777/jms_queue.
• Set a payload that you want to add to the queue.
• Drag and drop a JMS endpoint next to the HTTP inbound
endpoint.
Select “Active_MQ” for Connection Reference in the Connector
Configuration that we created in Step 2.
4. Create a Jms_receiver :
• Use a Jms endpoint to receive the messages in the queue. Its
configuration is as follows:
• Use a Logger to log the Received Message.
• Use Set-payload to send a response back to the Jms Service.
• The final JMS Receiver Message Flow is as below:
5. Run the sample:
• First, run ActiveMQ using executable “activemq-admin” from
<ACTIVEMQ_HOME>/bin folder. Make sure you can access the ActiveMQ
admin page using http://localhost:8161/.
• Run the JMS flow.
• Open http://localhost:7777/jms_queue.This will enqueue the
request to the ActiveMQ JMS Queue “queue”.
• Verify this by examining the ActiveMQ administration page at
http://localhost:8161/admin/queues.jsp. We can see the messages
under the “Messages Enqueued” column.
• The Output you receive after the execution is the Payload Set by
the JMS-Client.
• Note: Only one client can read from a queue at one time and the
messages read from the queue are removed from the queue. If
you want to perform any transactions on top of JMS then the

More Related Content

What's hot

Do we need JMS in 21st century?
Do we need JMS in 21st century?Do we need JMS in 21st century?
Do we need JMS in 21st century?Mikalai Alimenkou
 
What is the difference between using private flow
What is the difference between using private flowWhat is the difference between using private flow
What is the difference between using private flowSon Nguyen
 
Message structure
Message structureMessage structure
Message structureSon Nguyen
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connectorAnkush Sharma
 
ActiveMQ In Action
ActiveMQ In ActionActiveMQ In Action
ActiveMQ In ActionBruce Snyder
 
Muleflowarchitecturepart2
Muleflowarchitecturepart2Muleflowarchitecturepart2
Muleflowarchitecturepart2vijaynerd
 
Synchronous jms in mule
Synchronous jms in muleSynchronous jms in mule
Synchronous jms in mulecharle819
 
Mule Amazon SNS Connector
Mule Amazon SNS ConnectorMule Amazon SNS Connector
Mule Amazon SNS ConnectorAnkush Sharma
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mulejaveed_mhd
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mulePraneethchampion
 
Scatter gatherinmule
Scatter gatherinmuleScatter gatherinmule
Scatter gatherinmuleF K
 
How to use vm component
How to use vm componentHow to use vm component
How to use vm componentmaheshtheapex
 
ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011Bruce Snyder
 

What's hot (20)

Mule jms
Mule   jmsMule   jms
Mule jms
 
Mule LDAP Connector
Mule LDAP ConnectorMule LDAP Connector
Mule LDAP Connector
 
Do we need JMS in 21st century?
Do we need JMS in 21st century?Do we need JMS in 21st century?
Do we need JMS in 21st century?
 
What is the difference between using private flow
What is the difference between using private flowWhat is the difference between using private flow
What is the difference between using private flow
 
Mule esb introduction
Mule esb introductionMule esb introduction
Mule esb introduction
 
Message structure
Message structureMessage structure
Message structure
 
Mule with jms
Mule with jmsMule with jms
Mule with jms
 
Mule: Java Component
Mule: Java ComponentMule: Java Component
Mule: Java Component
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
 
ActiveMQ In Action
ActiveMQ In ActionActiveMQ In Action
ActiveMQ In Action
 
Muleflowarchitecturepart2
Muleflowarchitecturepart2Muleflowarchitecturepart2
Muleflowarchitecturepart2
 
Synchronous jms in mule
Synchronous jms in muleSynchronous jms in mule
Synchronous jms in mule
 
Mule Amazon SNS Connector
Mule Amazon SNS ConnectorMule Amazon SNS Connector
Mule Amazon SNS Connector
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Vm Component
Vm ComponentVm Component
Vm Component
 
Scatter gatherinmule
Scatter gatherinmuleScatter gatherinmule
Scatter gatherinmule
 
How to use vm component
How to use vm componentHow to use vm component
How to use vm component
 
Mule JMS transport
Mule JMS transportMule JMS transport
Mule JMS transport
 
ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011
 

Viewers also liked

Mule with data weave
Mule with data weaveMule with data weave
Mule with data weaveSon Nguyen
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-boundSon Nguyen
 
Using message enricher
Using message enricherUsing message enricher
Using message enricherSon Nguyen
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connectionSon Nguyen
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in muleSon Nguyen
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starterSon Nguyen
 
Batch job processing
Batch job processingBatch job processing
Batch job processingSon Nguyen
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in muleSon Nguyen
 
Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introductionSon Nguyen
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overviewSon Nguyen
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with muleSon Nguyen
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filterSon Nguyen
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in muleSon Nguyen
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with muleSon Nguyen
 
How messaging apps are changing the way we communicate
How messaging apps are changing the way we communicateHow messaging apps are changing the way we communicate
How messaging apps are changing the way we communicate1000heads
 
Mule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthMule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthSara Peralta
 
Mule Cloud Conectores-Conceptos
Mule Cloud Conectores-ConceptosMule Cloud Conectores-Conceptos
Mule Cloud Conectores-ConceptosSara Peralta
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectorsSon Nguyen
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectorsSon Nguyen
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoftSon Nguyen
 

Viewers also liked (20)

Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starter
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
How messaging apps are changing the way we communicate
How messaging apps are changing the way we communicateHow messaging apps are changing the way we communicate
How messaging apps are changing the way we communicate
 
Mule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthMule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuth
 
Mule Cloud Conectores-Conceptos
Mule Cloud Conectores-ConceptosMule Cloud Conectores-Conceptos
Mule Cloud Conectores-Conceptos
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectors
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 

Similar to Jms queue (20)

Mule jms queues
Mule jms queuesMule jms queues
Mule jms queues
 
Jms queues
Jms queuesJms queues
Jms queues
 
Jms topics
Jms topicsJms topics
Jms topics
 
Mule jms-topics
Mule jms-topicsMule jms-topics
Mule jms-topics
 
Jms topics
Jms   topicsJms   topics
Jms topics
 
Active mq read and write flow in mule
Active mq  read and write flow in muleActive mq  read and write flow in mule
Active mq read and write flow in mule
 
Jms using j boss
Jms using j bossJms using j boss
Jms using j boss
 
Apache ActiveMQ
Apache ActiveMQ Apache ActiveMQ
Apache ActiveMQ
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
Connecting Applications Everywhere with ActiveMQ
Connecting Applications Everywhere with ActiveMQConnecting Applications Everywhere with ActiveMQ
Connecting Applications Everywhere with ActiveMQ
 
Ranker jms implementation
Ranker jms implementationRanker jms implementation
Ranker jms implementation
 

More from Son Nguyen

Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler muleSon Nguyen
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with muleSon Nguyen
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in muleSon Nguyen
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introductionSon Nguyen
 
Runing batch job in mule
Runing batch job in muleRuning batch job in mule
Runing batch job in muleSon Nguyen
 
Mule integration with cloud hub
Mule integration with cloud hubMule integration with cloud hub
Mule integration with cloud hubSon Nguyen
 
Idempotent filter with mule
Idempotent filter with muleIdempotent filter with mule
Idempotent filter with muleSon Nguyen
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introductionSon Nguyen
 
Accessing jms by groovy
Accessing jms by groovyAccessing jms by groovy
Accessing jms by groovySon Nguyen
 
Executing oracle ebs stored
Executing oracle ebs storedExecuting oracle ebs stored
Executing oracle ebs storedSon Nguyen
 
Mule batch introduction
Mule batch introductionMule batch introduction
Mule batch introductionSon Nguyen
 
Adding dynamic file
Adding dynamic fileAdding dynamic file
Adding dynamic fileSon Nguyen
 
Create folder in microsoft share point
Create folder in microsoft share pointCreate folder in microsoft share point
Create folder in microsoft share pointSon Nguyen
 

More from Son Nguyen (13)

Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 
Runing batch job in mule
Runing batch job in muleRuning batch job in mule
Runing batch job in mule
 
Mule integration with cloud hub
Mule integration with cloud hubMule integration with cloud hub
Mule integration with cloud hub
 
Idempotent filter with mule
Idempotent filter with muleIdempotent filter with mule
Idempotent filter with mule
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introduction
 
Accessing jms by groovy
Accessing jms by groovyAccessing jms by groovy
Accessing jms by groovy
 
Executing oracle ebs stored
Executing oracle ebs storedExecuting oracle ebs stored
Executing oracle ebs stored
 
Mule batch introduction
Mule batch introductionMule batch introduction
Mule batch introduction
 
Adding dynamic file
Adding dynamic fileAdding dynamic file
Adding dynamic file
 
Create folder in microsoft share point
Create folder in microsoft share pointCreate folder in microsoft share point
Create folder in microsoft share point
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

Jms queue

  • 2. JMS • JMS (Java Message Service) is a widely-used API for Message Oriented Middleware. It allows communication between different components of a distributed application to be loosely coupled, reliable, and asynchronous. • JMS supports two models for messaging: • Queues - Point-to-point • Topics - Publish and subscribe • Mule's JMS transport lets you easily send and receive messages to queues and topics for any message service which implements the JMS specification.
  • 3. QUEUES • In the point-to-point or queuing model, a sender posts messages to a particular queue and a receiver reads messages from the queue. Here, the sender knows the destination of the message and posts the message directly to the receiver's queue. It is characterized by the following: • Only one consumer gets the message • The producer does not have to be running at the time the consumer consumes the message, nor does the consumer need to be running at the time the message is sent • Every message successfully processed is acknowledged by the consumer
  • 4. Configuration with Example: • Anypoint Studio offers easy-to-use components to connect to JMS Queues and Topics. In the below example, we will use ActiveMQ, a leading open source JMS implementation from Apache that supports JMS. • The outline of the simple steps required to implement this example is as follows: • Import ActiveMQ libraries • Create an ActiveMQ connector • Enqueue to JMS Queue • Run the sample
  • 5. 1. Import ActiveMQ Library: • Download Apache ActiveMQ binaries (ActiveMQ 5.11) from http://activemq.apache.org/download.html. Unzip the compressed file to any folder on your file system. Let’s call it <ACTIVEMQ_HOME>. • Create a new flow in Mule Studio and name it “jms”. To configure the project to use ActiveMQ libraries, right-click on the project -> Properties -> Java Build Path -> Add External JARs. Select “activemq-all-5.11-SNAPSHOT.jar” from <ACTIVEMQ_HOME>.
  • 6.
  • 7. 2. Create an ActiveMQ Connector: • Double-click on “jms” flow to bring up the message flow. Click on the “Global Elements” tab. Click on “Create” and locate ActiveMQ under “Connectors -> JMS” and click OK.
  • 8. 3. Enqueue to JMS Queue: • We will use the request payload received from an HTTP inbound endpoint to seed the ActiveMQ Queue. Open the “jms” message flow and drag and drop an HTTP endpoint on to the flow. • Double-click on the HTTP endpoint to bring up the properties dialog. Specify “jms_queue” for Path. This will make the HTTP endpoint accessible using URL http://localhost:7777/jms_queue. • Set a payload that you want to add to the queue. • Drag and drop a JMS endpoint next to the HTTP inbound endpoint.
  • 9. Select “Active_MQ” for Connection Reference in the Connector Configuration that we created in Step 2.
  • 10. 4. Create a Jms_receiver : • Use a Jms endpoint to receive the messages in the queue. Its configuration is as follows:
  • 11. • Use a Logger to log the Received Message. • Use Set-payload to send a response back to the Jms Service. • The final JMS Receiver Message Flow is as below: 5. Run the sample: • First, run ActiveMQ using executable “activemq-admin” from <ACTIVEMQ_HOME>/bin folder. Make sure you can access the ActiveMQ admin page using http://localhost:8161/.
  • 12. • Run the JMS flow. • Open http://localhost:7777/jms_queue.This will enqueue the request to the ActiveMQ JMS Queue “queue”. • Verify this by examining the ActiveMQ administration page at http://localhost:8161/admin/queues.jsp. We can see the messages under the “Messages Enqueued” column.
  • 13. • The Output you receive after the execution is the Payload Set by the JMS-Client. • Note: Only one client can read from a queue at one time and the messages read from the queue are removed from the queue. If you want to perform any transactions on top of JMS then the