SlideShare une entreprise Scribd logo
1  sur  15
Ravinder
 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.
 The publish/subscribe model supports publishing messages to a
particular message topic. Subscribers may register interest in
receiving messages on a particular message topic. In this model,
neither the publisher nor the subscriber knows about each other.
A good analogy for this is an anonymous bulletin board. The
following are characteristics of this model:
• Multiple consumers (or none) receive the message
• There is a timing dependency between publishers and
subscribers. The publisher has to create a message
topic for clients to subscribe.
• The subscriber has to remain continuously active to receive
messages, unless it has established a durable subscription. In that case,
messages published while the subscriber is not connected redistribute
when it reconnects.
Example:
JMS Publisher Flow Configuration:
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_topic” for Path. This will make the
HTTP endpoint accessible using URL http://localhost:7777/jms_topic.
Set a payload that you want to add to Publish.
 Drag and drop a JMS endpoint next to the HTTP inbound endpoint.
 Double-click the JMS endpoint to bring up the properties dialog.
Specify “topic” for Topic name and Select “Active_MQ” for
Connection Reference in the Connector Configuration that we
created earlier.
JMS Subscriber Flow Configuration:
Use a Jms endpoint to subscribe the Published messages.
Use a Logger to log the Received Message.
Use Set-payload to send a response back to the Jms Service.
Create another Subscriber to receive the same Published messages.
The final JMS Subscriber Message Flow is as below:
 Run the JMS flow. Open http://localhost:7777/jms_topic.
 This will publish the request to the ActiveMQ JMS Topic “topic”.
 Verify this by examining the ActiveMQ administration page at
http://localhost:8161/admin/topics.jsp. We can see the messages
enqueued, dequeued and the number of consumers.
 The Output you receive after the execution is the Payload Set by any
of the two subscribers JMS-Topic 1 or JMS-Topic2.
Example to understand how JMS uses serializing, and de-
serializing objects:
Serialization is a process of converting an object into a sequence of bytes
which can be persisted to a disk or database or can be sent through
streams. The reverse process of creating object from sequence of bytes is
called deserialization.
Steps to share Objects via JMS are:
1. 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_serializable_queue” for Path. This will
make the HTTP endpoint accessible using URL
http://localhost:7777//jms_serializable_queue.
2. Create a Java Class that implements the Serializable interface as
below:
3. Instantiate the class using Set-payload.
4. Set the values to the object using Expression.
5. Drag and drop a JMS endpoint next to the HTTP inbound endpoint.
Double-click the JMS endpoint to bring up the properties dialog.
Specify “serial_queue” for queue name. Select “Active_MQ” for
Connection Reference in the Connector Configuration that we created
earlier.
6. The JMS Client Message Flow is as below:
7. Use a Jms endpoint to receive the messages on the Destination with
the below configuration and Active_MQ is configured before.
8. Use an expression to print the contents of the received payload.
9. Use a Logger to log the Received Message.
10. The final JMS Subscriber Message Flow is as below:
 Run the JMS flow. Open
http://localhost:7777/jms_serialiable_queue.
 This will publish the request to the ActiveMQ JMS Topic “topic”.
Verify this by examining the ActiveMQ administration page at
http://localhost:8161/admin/queues.jsp. We can see the messages
enqueued, dequeued and the number of consumers.
 The Output you receive after the execution is the name that is sent
from the Client.
 The Serializable implementation is done in a similar way using
Topic but with many publishers and subscribers.
 Thank You All

Contenu connexe

Tendances

Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1
von gosling
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMS
Bruce Snyder
 
JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers Overview
Vadym Lotar
 

Tendances (20)

Jms queues
Jms queuesJms queues
Jms queues
 
Messaging Frameworks using JMS
Messaging Frameworks using JMS Messaging Frameworks using JMS
Messaging Frameworks using JMS
 
Mule esb
Mule esbMule esb
Mule esb
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
JMS Backchannel
JMS BackchannelJMS Backchannel
JMS Backchannel
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1
 
Message structure
Message structureMessage structure
Message structure
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMS
 
Anypoint mq queues and exchanges
Anypoint mq queues and exchangesAnypoint mq queues and exchanges
Anypoint mq queues and exchanges
 
Mule
MuleMule
Mule
 
M messaging 2
M messaging 2M messaging 2
M messaging 2
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers Overview
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Connecting to external_application
Connecting to external_applicationConnecting to external_application
Connecting to external_application
 
Splitters in mule
Splitters in muleSplitters in mule
Splitters in mule
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Mule LDAP Connector
Mule LDAP ConnectorMule LDAP Connector
Mule LDAP Connector
 
Mule soft jms
Mule soft jmsMule soft jms
Mule soft jms
 
Mule routing and filters
Mule routing and filtersMule routing and filters
Mule routing and filters
 

En vedette

Are Tablet Buyers Taking Over Ecommerce?
Are Tablet Buyers Taking Over Ecommerce?Are Tablet Buyers Taking Over Ecommerce?
Are Tablet Buyers Taking Over Ecommerce?
G3 Communications
 
MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...
MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...
MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...
European School of Oncology
 

En vedette (12)

RGO - Pr D.A. BENAJAH
RGO - Pr D.A. BENAJAHRGO - Pr D.A. BENAJAH
RGO - Pr D.A. BENAJAH
 
Trithérapie dans les Hépatites Virales C - Dr BELAZIZ Hanae
Trithérapie dans les Hépatites Virales C - Dr BELAZIZ HanaeTrithérapie dans les Hépatites Virales C - Dr BELAZIZ Hanae
Trithérapie dans les Hépatites Virales C - Dr BELAZIZ Hanae
 
Are Tablet Buyers Taking Over Ecommerce?
Are Tablet Buyers Taking Over Ecommerce?Are Tablet Buyers Taking Over Ecommerce?
Are Tablet Buyers Taking Over Ecommerce?
 
Announcements 02.21.16
Announcements 02.21.16Announcements 02.21.16
Announcements 02.21.16
 
2015 DeRiVE FrameBase event integration presentation
2015 DeRiVE FrameBase event integration presentation2015 DeRiVE FrameBase event integration presentation
2015 DeRiVE FrameBase event integration presentation
 
#JRES2015 #LightningTalks - Outils libres pour la gestion d'un parc de machin...
#JRES2015 #LightningTalks - Outils libres pour la gestion d'un parc de machin...#JRES2015 #LightningTalks - Outils libres pour la gestion d'un parc de machin...
#JRES2015 #LightningTalks - Outils libres pour la gestion d'un parc de machin...
 
Χριστιανισμός
ΧριστιανισμόςΧριστιανισμός
Χριστιανισμός
 
Resume
ResumeResume
Resume
 
MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...
MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...
MCO 2011 - Slide 8 - E. Senkus-Konefka - Treatment of metastatic disease and ...
 
HD Basses - Pr H. SBAI
HD Basses - Pr H. SBAIHD Basses - Pr H. SBAI
HD Basses - Pr H. SBAI
 
Το υγρό πυρ
Το υγρό πυρΤο υγρό πυρ
Το υγρό πυρ
 
High school
High school   High school
High school
 

Similaire à Jms topics (20)

Mule jms queues
Mule jms queuesMule jms queues
Mule jms queues
 
Jms queue
Jms queueJms queue
Jms queue
 
Test DB user
Test DB userTest DB user
Test DB user
 
test validation
test validationtest validation
test validation
 
JMS
JMSJMS
JMS
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
Java Messaging Services
Java Messaging ServicesJava Messaging Services
Java Messaging Services
 
Mule with jms
Mule with jmsMule with jms
Mule with jms
 
Java message service
Java message serviceJava message service
Java message service
 
Introduction java messaging services
Introduction java messaging servicesIntroduction java messaging services
Introduction java messaging services
 
Jms
JmsJms
Jms
 
Jms
JmsJms
Jms
 
Jms
JmsJms
Jms
 

Plus de Ravinder Singh (11)

Mule in a nutshell
Mule in a nutshellMule in a nutshell
Mule in a nutshell
 
Mule java part-4
Mule java part-4Mule java part-4
Mule java part-4
 
Mule java part-3
Mule java part-3Mule java part-3
Mule java part-3
 
Mule java part-2
Mule java part-2Mule java part-2
Mule java part-2
 
Mule java part-1
Mule java part-1Mule java part-1
Mule java part-1
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 
Mule enricher
Mule enricher Mule enricher
Mule enricher
 
Mule properties
Mule propertiesMule properties
Mule properties
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Mule batch processing
Mule batch processingMule batch processing
Mule batch processing
 
Mule expression
Mule expressionMule expression
Mule expression
 

Dernier

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Dernier (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Jms topics

  • 2.  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.  The publish/subscribe model supports publishing messages to a particular message topic. Subscribers may register interest in receiving messages on a particular message topic. In this model, neither the publisher nor the subscriber knows about each other. A good analogy for this is an anonymous bulletin board. The following are characteristics of this model: • Multiple consumers (or none) receive the message • There is a timing dependency between publishers and subscribers. The publisher has to create a message topic for clients to subscribe.
  • 4. • The subscriber has to remain continuously active to receive messages, unless it has established a durable subscription. In that case, messages published while the subscriber is not connected redistribute when it reconnects. Example: JMS Publisher Flow Configuration: 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_topic” for Path. This will make the HTTP endpoint accessible using URL http://localhost:7777/jms_topic. Set a payload that you want to add to Publish.
  • 5.  Drag and drop a JMS endpoint next to the HTTP inbound endpoint.  Double-click the JMS endpoint to bring up the properties dialog. Specify “topic” for Topic name and Select “Active_MQ” for Connection Reference in the Connector Configuration that we created earlier.
  • 6. JMS Subscriber Flow Configuration: Use a Jms endpoint to subscribe the Published messages. Use a Logger to log the Received Message. Use Set-payload to send a response back to the Jms Service. Create another Subscriber to receive the same Published messages. The final JMS Subscriber Message Flow is as below:
  • 7.  Run the JMS flow. Open http://localhost:7777/jms_topic.  This will publish the request to the ActiveMQ JMS Topic “topic”.  Verify this by examining the ActiveMQ administration page at http://localhost:8161/admin/topics.jsp. We can see the messages enqueued, dequeued and the number of consumers.  The Output you receive after the execution is the Payload Set by any of the two subscribers JMS-Topic 1 or JMS-Topic2.
  • 8. Example to understand how JMS uses serializing, and de- serializing objects: Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Steps to share Objects via JMS are: 1. 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_serializable_queue” for Path. This will make the HTTP endpoint accessible using URL http://localhost:7777//jms_serializable_queue.
  • 9. 2. Create a Java Class that implements the Serializable interface as below:
  • 10. 3. Instantiate the class using Set-payload. 4. Set the values to the object using Expression.
  • 11. 5. Drag and drop a JMS endpoint next to the HTTP inbound endpoint. Double-click the JMS endpoint to bring up the properties dialog. Specify “serial_queue” for queue name. Select “Active_MQ” for Connection Reference in the Connector Configuration that we created earlier.
  • 12. 6. The JMS Client Message Flow is as below: 7. Use a Jms endpoint to receive the messages on the Destination with the below configuration and Active_MQ is configured before. 8. Use an expression to print the contents of the received payload.
  • 13. 9. Use a Logger to log the Received Message. 10. The final JMS Subscriber Message Flow is as below:
  • 14.  Run the JMS flow. Open http://localhost:7777/jms_serialiable_queue.  This will publish the request to the ActiveMQ JMS Topic “topic”. Verify this by examining the ActiveMQ administration page at http://localhost:8161/admin/queues.jsp. We can see the messages enqueued, dequeued and the number of consumers.  The Output you receive after the execution is the name that is sent from the Client.  The Serializable implementation is done in a similar way using Topic but with many publishers and subscribers.