SlideShare a Scribd company logo
1 of 12
Introduction
Java Messaging Services (JMS)
JMS MESSAGING MODEL
• JMS supports two models for messaging
• JMS Queue
• JMS Topic
Java Messaging Services
(JMS)
• A message oriented middleware
• Supports creation of message based
applications
• Supports loosely coupled middleware
• Supports transactions
• Supports reliability
JMS QUEUE
• Standard Queuing
• First In First Out (FIFO)
• Point to point i.e., single producer and
single consumer
• The behavior is similar to Mule VM
queues
JMS TOPIC
• Enables publish and subscribe mechanism
• The model is similar to RSS feed
• Multiple subscribers can subscribe to a topic
• Supports publishing a message even if subscriber
is disconnected using durable attribute in mule JMS
Message
Publisher
Message Subscriber
1
Message
Subscriber 2
Message Subscriber
N
JMS backchannel
• Backchannel allows response to be returned back in synchronous mule
message flow
• There are two ways to create backchannel in Mule
• Define your outbound endpoint with request-response exchange pattern
• Use a request-reply message processor
• Backchannel allows JMS endpoint to behave as two way channel
• It internally sets “reply-to” header that tells mule where to send a response
Client Server
Channel
Backchannel
Transport
MESSAGE FILTER IN JMS
• Mule supports selecting specific
messages at the consumers end by
using JMS selector
• JMS selector can use JMS header
properties
• Non matching messages remains in the
<jms:inbound-endpoint connector-ref="Active_MQ" doc:name="ActiveMQ"
topic="TestTopic">
<jms:selector expression="JMSPriority=5" />
</jms:inbound-endpoint>
JMS TRANSFORMERS IN MULE
• The default transformers applied to JMS endpoints are as
follows:
• inbound = JMSMessageToObject
• outbound = ObjectToJMSMessage
• response = ObjectToJMSMessage
• The transformation happens to/from as given below
JMS Type Java Type
javax.jms.TextMessage java.lang.String
javax.jms.ObjectMessage java.lang.Object
javax.jms.BytesMessage byte[]
javax.jms.MapMessage java.util.Map
javax.jms.StreamMessage java.io.InputStream
EXAMPLE CONFIGURATION FOR
ACTIVE MQ
• Configuring a JMS connector using
ActiveMQ
• Defining JMS outbound endpoint
• Defining JMS inbound endpoint
• The example configuration for JMS
connector and inbound/outbound
endpoints are given in coming slides and
configuration is using a JMS topic
CONFIGURING A JMS CONNECTOR USING
ACTIVE MQ
<jms:activemq-connector name="Active_MQ" specification="1.1"
username="username" password="password" brokerURL="tcp://host:port"
validateConnections="true" doc:name="Active MQ"/>
DEFINING JMS OUTBOUND
ENDPOINT
<jms:outbound-endpoint topic="TestTopic" connector-ref="Active_MQ"
doc:name="JMS"/>
DEFINING JMS INBOUND
ENDPOINT
<jms:inbound-endpoint connector-ref="Active_MQ“ doc:name="ActiveMQ"
topic="TestTopic"/>

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
 
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 JMSBruce Snyder
 
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
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mulePraneethchampion
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQGeert Pante
 
Scatter gatherinmule
Scatter gatherinmuleScatter gatherinmule
Scatter gatherinmuleF K
 
ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011Bruce Snyder
 
Mule Amazon SNS Connector
Mule Amazon SNS ConnectorMule Amazon SNS Connector
Mule Amazon SNS ConnectorAnkush Sharma
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation FilterAnkush Sharma
 

What's hot (20)

Mule jms
Mule   jmsMule   jms
Mule jms
 
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?
 
Mule LDAP Connector
Mule LDAP ConnectorMule LDAP Connector
Mule LDAP Connector
 
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
 
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
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Mule JMS transport
Mule JMS transportMule JMS transport
Mule JMS transport
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQ
 
Scatter gatherinmule
Scatter gatherinmuleScatter gatherinmule
Scatter gatherinmule
 
ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011ActiveMQ In Action - ApacheCon 2011
ActiveMQ In Action - ApacheCon 2011
 
Mule Amazon SNS Connector
Mule Amazon SNS ConnectorMule Amazon SNS Connector
Mule Amazon SNS Connector
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
 
Vm Component
Vm ComponentVm Component
Vm Component
 

Viewers also liked

Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with muleSon Nguyen
 
Accessing jms by groovy
Accessing jms by groovyAccessing jms by groovy
Accessing jms by groovySon Nguyen
 
Adding dynamic file
Adding dynamic fileAdding dynamic file
Adding dynamic fileSon Nguyen
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starterSon Nguyen
 
Multi database access
Multi database accessMulti database access
Multi database accessSon Nguyen
 
Request in mule
Request in muleRequest in mule
Request in muleSon Nguyen
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in muleSon Nguyen
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in muleSon Nguyen
 

Viewers also liked (9)

Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Accessing jms by groovy
Accessing jms by groovyAccessing jms by groovy
Accessing jms by groovy
 
Adding dynamic file
Adding dynamic fileAdding dynamic file
Adding dynamic file
 
Xml transform
Xml transformXml transform
Xml transform
 
Using map and list starter
Using map and list starterUsing map and list starter
Using map and list starter
 
Multi database access
Multi database accessMulti database access
Multi database access
 
Request in mule
Request in muleRequest in mule
Request in mule
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
Using groovy in mule
Using groovy in muleUsing groovy in mule
Using groovy in mule
 

Similar to Introduction java messaging services

Similar to Introduction java messaging services (20)

Introduction tojms
Introduction tojmsIntroduction tojms
Introduction tojms
 
Mule jms-topics
Mule jms-topicsMule jms-topics
Mule jms-topics
 
Jms topics
Jms topicsJms topics
Jms topics
 
Mule jms queues
Mule jms queuesMule jms queues
Mule jms queues
 
Jms topics
Jms   topicsJms   topics
Jms topics
 
Synchronous jms in mule
Synchronous jms in muleSynchronous jms in mule
Synchronous jms in mule
 
Jms using j boss
Jms using j bossJms using j boss
Jms using j boss
 
Weblogic - Introduction to configure JMS
Weblogic  - Introduction to configure JMSWeblogic  - Introduction to configure JMS
Weblogic - Introduction to configure JMS
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
Jms queues
Jms queuesJms queues
Jms queues
 
A detailed Tibco EMS presentation
A detailed Tibco EMS presentationA detailed Tibco EMS presentation
A detailed Tibco EMS presentation
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
test
testtest
test
 
Indianapolis mule soft_meetup_12_june_2021
Indianapolis mule soft_meetup_12_june_2021Indianapolis mule soft_meetup_12_june_2021
Indianapolis mule soft_meetup_12_june_2021
 

More from Son Nguyen

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introductionSon Nguyen
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with muleSon Nguyen
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overviewSon 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
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in muleSon Nguyen
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weaveSon Nguyen
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler muleSon 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
 
Batch job processing
Batch job processingBatch job processing
Batch job processingSon 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
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in muleSon Nguyen
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoftSon Nguyen
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectorsSon 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
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectorsSon Nguyen
 

More from Son Nguyen (20)

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
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
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
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
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
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
 
Mule with workday connectors
Mule with workday connectorsMule with workday connectors
Mule with workday connectors
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Introduction java messaging services

  • 2. JMS MESSAGING MODEL • JMS supports two models for messaging • JMS Queue • JMS Topic
  • 3. Java Messaging Services (JMS) • A message oriented middleware • Supports creation of message based applications • Supports loosely coupled middleware • Supports transactions • Supports reliability
  • 4. JMS QUEUE • Standard Queuing • First In First Out (FIFO) • Point to point i.e., single producer and single consumer • The behavior is similar to Mule VM queues
  • 5. JMS TOPIC • Enables publish and subscribe mechanism • The model is similar to RSS feed • Multiple subscribers can subscribe to a topic • Supports publishing a message even if subscriber is disconnected using durable attribute in mule JMS Message Publisher Message Subscriber 1 Message Subscriber 2 Message Subscriber N
  • 6. JMS backchannel • Backchannel allows response to be returned back in synchronous mule message flow • There are two ways to create backchannel in Mule • Define your outbound endpoint with request-response exchange pattern • Use a request-reply message processor • Backchannel allows JMS endpoint to behave as two way channel • It internally sets “reply-to” header that tells mule where to send a response Client Server Channel Backchannel Transport
  • 7. MESSAGE FILTER IN JMS • Mule supports selecting specific messages at the consumers end by using JMS selector • JMS selector can use JMS header properties • Non matching messages remains in the <jms:inbound-endpoint connector-ref="Active_MQ" doc:name="ActiveMQ" topic="TestTopic"> <jms:selector expression="JMSPriority=5" /> </jms:inbound-endpoint>
  • 8. JMS TRANSFORMERS IN MULE • The default transformers applied to JMS endpoints are as follows: • inbound = JMSMessageToObject • outbound = ObjectToJMSMessage • response = ObjectToJMSMessage • The transformation happens to/from as given below JMS Type Java Type javax.jms.TextMessage java.lang.String javax.jms.ObjectMessage java.lang.Object javax.jms.BytesMessage byte[] javax.jms.MapMessage java.util.Map javax.jms.StreamMessage java.io.InputStream
  • 9. EXAMPLE CONFIGURATION FOR ACTIVE MQ • Configuring a JMS connector using ActiveMQ • Defining JMS outbound endpoint • Defining JMS inbound endpoint • The example configuration for JMS connector and inbound/outbound endpoints are given in coming slides and configuration is using a JMS topic
  • 10. CONFIGURING A JMS CONNECTOR USING ACTIVE MQ <jms:activemq-connector name="Active_MQ" specification="1.1" username="username" password="password" brokerURL="tcp://host:port" validateConnections="true" doc:name="Active MQ"/>
  • 11. DEFINING JMS OUTBOUND ENDPOINT <jms:outbound-endpoint topic="TestTopic" connector-ref="Active_MQ" doc:name="JMS"/>
  • 12. DEFINING JMS INBOUND ENDPOINT <jms:inbound-endpoint connector-ref="Active_MQ“ doc:name="ActiveMQ" topic="TestTopic"/>