SlideShare a Scribd company logo
1 of 30
hSenid Lanka: Java Message Service
By Kasun Dinesh Madusanke
JMS
(Java Message Service)
hSenid Lanka: JMS
2
Topics
o Message and Messaging
o What is JMS?
o Goals of JMS
o Benefits of JMS
o When to use JMS?
o JMS Message
3
Topics Cont.
o Java Mail vs JMS
o JMS Components
o JMS Application
o MOM Service Providers
o Messaging Models
o JMS API Programming Model
hSenid Lanka: JMS
4
Topics Cont.
o Demo-JMS Pure Java
o Spring JMS
o JMSTemplate
o Demo-Spring JMS
o Summary
hSenid Lanka: JMS
5
Message & Messaging
▸Bytes of data that is meaningful between the applications
which use it.
▸Used to transfer information form one application to
others.
hSenid Lanka: JMS
Message
▸Communication between system components or different
applications.
Messaging
6
What is JMS?
▸JMS is a Message Oriented Middleware (MOM)
▸Published and maintained by Sun Microsystems
▸First published in August 1998
▸Loosely coupled communication
▸Asynchronous messaging
▸Reliable delivery
hSenid Lanka: JMS
7
What is JMS? Cont.
hSenid Lanka: JMS
8
Goals of JMS
▸Minimizes the set of concepts a programmer must
learn to use messaging products (programmer
friendly).
▸Provides enough features to support sophisticated
messaging applications.
▸Maximize the portability of JMS applications across
JMS providers in the same messaging domain.
hSenid Lanka: JMS
9
When to use JMS?
▸The provider wants the components not to depend on
information about other components' interfaces, so that
components can be easily replaced.
▸The provider wants the application to run whether or not
all components are up and running simultaneously.
▸The application business model allows a component to
send information to another and to continue to operate
without receiving an immediate response.
hSenid Lanka: JMS
10
JMS Message
hSenid Lanka: JMS
Header
Properties
Body
This image shows the
Structure of a JMS Message
11
hSenid Lanka: JMS
Header Properties Body
Identify message Added by the application developer Message body
Destination Application specific properties Can contain arbitrary data types
Eg:
Text messages
Map (key-value pairs)
XML
Serialized objects (Java)
Binary data
Empty
Routing Information Key-value pairs
Priority Extensions for messaging systems
Timestamp
Message type
Header, Properties and Body
12
Java Mail vs JMS
hSenid Lanka: JMS
Java Mail JMS
API for sending emails (eg: with
attachments).
Capable of exchanging messages between
applications.
Mainly for human information exchange
Application/Human to Application/Human
Messaging.
Delivery can be duplicated.
More like a database. Messages removed once it
reads by the recipient system.
Delivery not guaranteed. Delivery is guaranteed (Above reason).
Designed for connectivity on the web.
Bunch of different qualities of service (durable vs
non-durable, queue vs topic).
13
JMS Components
▸JMS Provider:
▹ The messaging system (MOM) that implements JMS.
▸JMS Clients
▹ Java applications that produce/receive messages.
▸JMS Producer/Publisher
▹ A JMS client that creates and sends messages.
▸JMS Consumer/Subscriber
▹ A JMS client that receives messages.
▸JMS Application
▹ The system composed of JMS clients and a JMS provider.
hSenid Lanka: JMS
14
JMS Application
hSenid Lanka: JMS
15
MOM Service Providers
hSenid Lanka: JMS
Service provider Product Company
Weblogic Oracle
MQSeries IBM
JBOSSMQ JBOSS
SoniqMQ Progress
TIBCO EMS TIBCO
ActiveMQ Apache
16
Messaging Models
hSenid Lanka: JMS
17
Messaging Models Cont.
▸Point to Point
▹ Message queues, senders and receivers.
▹ Message is sent to a queue.
▹ Each message has only one consumer.
▹ Queue may be configured to persist messages.
▸Publish-Subscribe
▹ Publishers, subscribers, topics.
▹ Message may have multiple consumers, or no consumer at all.
▹ Each message is delivered to every client subscribed to a topic.
hSenid Lanka: JMS
18
Messaging Models Cont.
hSenid Lanka: JMS
▸Point to Point
19
Messaging Models Cont.
hSenid Lanka: JMS
▸Publish-Subscribe
20
Messaging Models Cont.
hSenid Lanka: JMS
PTP vs PUB/SUB
Point to Point Publish-Subscribe
Each message has only one consumer. Each message can have multiple consumers.
Messages first sent to a destination called Queue. Messages first sent to a destination called Topic.
A sender and receiver of a message have no timing
dependencies (receiver can fetch the message
later).
Publishers and subscribers have a timing
dependency (client need to be subscribed and
active).
The receiver acknowledges the successful
processing of a message.
Does not provide acknowledgement.
21
JMS API Programming Model
hSenid Lanka: JMS
22
JMS API Programming Model Cont.
hSenid Lanka: JMS
▸Connection Factory
▹ The client uses an object which is a connection factory used to
create a connection to a provider.
▹ It creates connection between JMS Provider and JMS Client.
▸Connection
▹ A JMS connection encapsulates a virtual connection with a JMS
provider.
▹ it is an open TCP/IP socket between a client and a provider
service daemon.
23
JMS API Programming Model Cont.
hSenid Lanka: JMS
▸Session
▹ The session is a single threaded context which is used for
producing and consuming messages.
▹ The sessions are used to create the following:
▹ Message Producers
▹ Message Consumers
24
JMS API Programming Model Cont.
hSenid Lanka: JMS
▸Message Producer
▹ A JMS message producer object is created by a session.
▹ It is used for sending messages to a destination.
▸Message Consumer
▹ A JMS message consumer object is created by session.
▹ It helps for receiving messages sent to a destination.
25
DEMO
(JMS Pure Java)
hSenid Lanka: JMS
Download project files
26
Spring JMS
hSenid Lanka: JMS
▸Advantages
▹ No EJB container required (no JEE container)
▹ Simplified resource management
▹ Connection Factory, Connections, Destinations
▹ Simplified concurrency management
▹ Simplified transaction management
27
Spring JMS Cont.
hSenid Lanka: JMS
▸JMS Template
▹ Send and receive messages synchronously
▸Message Listener Container
▹ Receive messages asynchronously
▹ Message-Driven POJOs (MDPs)
28
JMSTemplate
hSenid Lanka: JMS
Method Description
browse() Browse messages in a queue
convertAndSend()
Send messages synchronously
Convert a Java object to a JMS message
execute() Provides access to callbacks for more complex scenarios
receive()
receiveAndConvert()
Receive messages synchronously
receiveSelected()
receiveSelectedAndConvert()
Receive filtered messages synchronously
send() Send a message synchronously using a MessageCreator
29
hSenid Lanka: JMS
DEMO
(Spring JMS)
Download project files
30hSenid Lanka: Java Message Service
By Kasun Dinesh Madusanke
THANK
YOU!

More Related Content

What's hot

SLF4J (Simple Logging Facade for Java)
SLF4J (Simple Logging Facade for Java)SLF4J (Simple Logging Facade for Java)
SLF4J (Simple Logging Facade for Java)Guo Albert
 
Javax.servlet,http packages
Javax.servlet,http packagesJavax.servlet,http packages
Javax.servlet,http packagesvamsi krishna
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http responseNuha Noor
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsSolution4Future
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation洪 鹏发
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JSArno Lordkronos
 
Caching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsCaching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsHARIHARAN ANANTHARAMAN
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web ArchitectureChamnap Chhorn
 
(M) brochure full stack development learning path
(M) brochure full stack development learning path(M) brochure full stack development learning path
(M) brochure full stack development learning pathNirupamNishant2
 
SPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesSPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesGabriel Walt
 
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 ServletServlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 ServletJustin Lin
 
Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityBruno Henrique Rother
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data AccessDzmitry Naskou
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questionspraveen_guda
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 

What's hot (20)

SLF4J (Simple Logging Facade for Java)
SLF4J (Simple Logging Facade for Java)SLF4J (Simple Logging Facade for Java)
SLF4J (Simple Logging Facade for Java)
 
Javax.servlet,http packages
Javax.servlet,http packagesJavax.servlet,http packages
Javax.servlet,http packages
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http response
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Caching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsCaching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and Pitfalls
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
(M) brochure full stack development learning path
(M) brochure full stack development learning path(M) brochure full stack development learning path
(M) brochure full stack development learning path
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
SPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager SitesSPA Editor - Adobe Experience Manager Sites
SPA Editor - Adobe Experience Manager Sites
 
Spring - Ecosistema
Spring - EcosistemaSpring - Ecosistema
Spring - Ecosistema
 
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 ServletServlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
 
Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring Security
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data Access
 
Web services SOAP
Web services SOAPWeb services SOAP
Web services SOAP
 
Ibm web sphere application server interview questions
Ibm web sphere application server interview questionsIbm web sphere application server interview questions
Ibm web sphere application server interview questions
 
Json Web Token - JWT
Json Web Token - JWTJson Web Token - JWT
Json Web Token - JWT
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 

Viewers also liked

JMS java messaging service
JMS java messaging serviceJMS java messaging service
JMS java messaging servicePROSKAR
 
Java Message Service
Java Message ServiceJava Message Service
Java Message ServiceAMIT YADAV
 
Андрей Кравец Тема: "Пришло время быть реактивным, или..?"
Андрей Кравец Тема: "Пришло время быть реактивным, или..?"Андрей Кравец Тема: "Пришло время быть реактивным, или..?"
Андрей Кравец Тема: "Пришло время быть реактивным, или..?"Ciklum Minsk
 
Apache Camel Lifecycle
Apache Camel LifecycleApache Camel Lifecycle
Apache Camel LifecycleIlya Lapitan
 
Apache Camel + Apache ActiveMQ persistence
Apache Camel + Apache ActiveMQ persistenceApache Camel + Apache ActiveMQ persistence
Apache Camel + Apache ActiveMQ persistenceIlya Lapitan
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration PatternsOleg Tsal-Tsalko
 
JDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented DesignJDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented DesignHossam Karim
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actiondejanb
 
Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success WSO2
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration PatternsSergey Podolsky
 
Messaging With ActiveMQ
Messaging With ActiveMQMessaging With ActiveMQ
Messaging With ActiveMQBruce Snyder
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsAlessandro Alinone
 
JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers OverviewVadym Lotar
 

Viewers also liked (20)

Java Messaging Service
Java Messaging ServiceJava Messaging Service
Java Messaging Service
 
Jms
JmsJms
Jms
 
JMS java messaging service
JMS java messaging serviceJMS java messaging service
JMS java messaging service
 
Jms
JmsJms
Jms
 
Java Message Service
Java Message ServiceJava Message Service
Java Message Service
 
Jms session (1)
Jms session (1)Jms session (1)
Jms session (1)
 
Андрей Кравец Тема: "Пришло время быть реактивным, или..?"
Андрей Кравец Тема: "Пришло время быть реактивным, или..?"Андрей Кравец Тема: "Пришло время быть реактивным, или..?"
Андрей Кравец Тема: "Пришло время быть реактивным, или..?"
 
JMS
JMSJMS
JMS
 
FINAL
FINALFINAL
FINAL
 
Apache Camel Lifecycle
Apache Camel LifecycleApache Camel Lifecycle
Apache Camel Lifecycle
 
Apache Camel + Apache ActiveMQ persistence
Apache Camel + Apache ActiveMQ persistenceApache Camel + Apache ActiveMQ persistence
Apache Camel + Apache ActiveMQ persistence
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
JDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented DesignJDC2008 - Enterprise Integration and Service Oriented Design
JDC2008 - Enterprise Integration and Service Oriented Design
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
 
Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success Patterns for Enterprise Integration Success
Patterns for Enterprise Integration Success
 
Enterprise Integration Patterns
Enterprise Integration PatternsEnterprise Integration Patterns
Enterprise Integration Patterns
 
Messaging With ActiveMQ
Messaging With ActiveMQMessaging With ActiveMQ
Messaging With ActiveMQ
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSockets
 
JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers Overview
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 

Similar to JMS-Java Message Service

Similar to JMS-Java Message Service (20)

Messaging Frameworks using JMS
Messaging Frameworks using JMS Messaging Frameworks using JMS
Messaging Frameworks using JMS
 
Jms intro
Jms introJms intro
Jms intro
 
WebLogic JMS System Best Practices
WebLogic JMS System Best PracticesWebLogic JMS System Best Practices
WebLogic JMS System Best Practices
 
Jms
JmsJms
Jms
 
#7 (Java Message Service)
#7 (Java Message Service)#7 (Java Message Service)
#7 (Java Message Service)
 
Weblogic - Introduction to configure JMS
Weblogic  - Introduction to configure JMSWeblogic  - Introduction to configure JMS
Weblogic - Introduction to configure JMS
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache Camel
 
JMS and ActiveMQ - VuNV 201307
JMS and ActiveMQ - VuNV 201307JMS and ActiveMQ - VuNV 201307
JMS and ActiveMQ - VuNV 201307
 
Jms
JmsJms
Jms
 
JMS01
JMS01JMS01
JMS01
 
Jms
JmsJms
Jms
 
Jms
JmsJms
Jms
 
Test DB user
Test DB userTest DB user
Test DB user
 
test validation
test validationtest validation
test validation
 
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
 
Jms topics
Jms topicsJms topics
Jms topics
 
Messaging in Java
Messaging in JavaMessaging in Java
Messaging in Java
 
Ranker jms implementation
Ranker jms implementationRanker jms implementation
Ranker jms implementation
 
Apache ActiveMQ
Apache ActiveMQ Apache ActiveMQ
Apache ActiveMQ
 
Mule jms-topics
Mule jms-topicsMule jms-topics
Mule jms-topics
 

Recently uploaded

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Recently uploaded (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

JMS-Java Message Service

  • 1. hSenid Lanka: Java Message Service By Kasun Dinesh Madusanke JMS (Java Message Service)
  • 2. hSenid Lanka: JMS 2 Topics o Message and Messaging o What is JMS? o Goals of JMS o Benefits of JMS o When to use JMS? o JMS Message
  • 3. 3 Topics Cont. o Java Mail vs JMS o JMS Components o JMS Application o MOM Service Providers o Messaging Models o JMS API Programming Model hSenid Lanka: JMS
  • 4. 4 Topics Cont. o Demo-JMS Pure Java o Spring JMS o JMSTemplate o Demo-Spring JMS o Summary hSenid Lanka: JMS
  • 5. 5 Message & Messaging ▸Bytes of data that is meaningful between the applications which use it. ▸Used to transfer information form one application to others. hSenid Lanka: JMS Message ▸Communication between system components or different applications. Messaging
  • 6. 6 What is JMS? ▸JMS is a Message Oriented Middleware (MOM) ▸Published and maintained by Sun Microsystems ▸First published in August 1998 ▸Loosely coupled communication ▸Asynchronous messaging ▸Reliable delivery hSenid Lanka: JMS
  • 7. 7 What is JMS? Cont. hSenid Lanka: JMS
  • 8. 8 Goals of JMS ▸Minimizes the set of concepts a programmer must learn to use messaging products (programmer friendly). ▸Provides enough features to support sophisticated messaging applications. ▸Maximize the portability of JMS applications across JMS providers in the same messaging domain. hSenid Lanka: JMS
  • 9. 9 When to use JMS? ▸The provider wants the components not to depend on information about other components' interfaces, so that components can be easily replaced. ▸The provider wants the application to run whether or not all components are up and running simultaneously. ▸The application business model allows a component to send information to another and to continue to operate without receiving an immediate response. hSenid Lanka: JMS
  • 10. 10 JMS Message hSenid Lanka: JMS Header Properties Body This image shows the Structure of a JMS Message
  • 11. 11 hSenid Lanka: JMS Header Properties Body Identify message Added by the application developer Message body Destination Application specific properties Can contain arbitrary data types Eg: Text messages Map (key-value pairs) XML Serialized objects (Java) Binary data Empty Routing Information Key-value pairs Priority Extensions for messaging systems Timestamp Message type Header, Properties and Body
  • 12. 12 Java Mail vs JMS hSenid Lanka: JMS Java Mail JMS API for sending emails (eg: with attachments). Capable of exchanging messages between applications. Mainly for human information exchange Application/Human to Application/Human Messaging. Delivery can be duplicated. More like a database. Messages removed once it reads by the recipient system. Delivery not guaranteed. Delivery is guaranteed (Above reason). Designed for connectivity on the web. Bunch of different qualities of service (durable vs non-durable, queue vs topic).
  • 13. 13 JMS Components ▸JMS Provider: ▹ The messaging system (MOM) that implements JMS. ▸JMS Clients ▹ Java applications that produce/receive messages. ▸JMS Producer/Publisher ▹ A JMS client that creates and sends messages. ▸JMS Consumer/Subscriber ▹ A JMS client that receives messages. ▸JMS Application ▹ The system composed of JMS clients and a JMS provider. hSenid Lanka: JMS
  • 15. 15 MOM Service Providers hSenid Lanka: JMS Service provider Product Company Weblogic Oracle MQSeries IBM JBOSSMQ JBOSS SoniqMQ Progress TIBCO EMS TIBCO ActiveMQ Apache
  • 17. 17 Messaging Models Cont. ▸Point to Point ▹ Message queues, senders and receivers. ▹ Message is sent to a queue. ▹ Each message has only one consumer. ▹ Queue may be configured to persist messages. ▸Publish-Subscribe ▹ Publishers, subscribers, topics. ▹ Message may have multiple consumers, or no consumer at all. ▹ Each message is delivered to every client subscribed to a topic. hSenid Lanka: JMS
  • 18. 18 Messaging Models Cont. hSenid Lanka: JMS ▸Point to Point
  • 19. 19 Messaging Models Cont. hSenid Lanka: JMS ▸Publish-Subscribe
  • 20. 20 Messaging Models Cont. hSenid Lanka: JMS PTP vs PUB/SUB Point to Point Publish-Subscribe Each message has only one consumer. Each message can have multiple consumers. Messages first sent to a destination called Queue. Messages first sent to a destination called Topic. A sender and receiver of a message have no timing dependencies (receiver can fetch the message later). Publishers and subscribers have a timing dependency (client need to be subscribed and active). The receiver acknowledges the successful processing of a message. Does not provide acknowledgement.
  • 21. 21 JMS API Programming Model hSenid Lanka: JMS
  • 22. 22 JMS API Programming Model Cont. hSenid Lanka: JMS ▸Connection Factory ▹ The client uses an object which is a connection factory used to create a connection to a provider. ▹ It creates connection between JMS Provider and JMS Client. ▸Connection ▹ A JMS connection encapsulates a virtual connection with a JMS provider. ▹ it is an open TCP/IP socket between a client and a provider service daemon.
  • 23. 23 JMS API Programming Model Cont. hSenid Lanka: JMS ▸Session ▹ The session is a single threaded context which is used for producing and consuming messages. ▹ The sessions are used to create the following: ▹ Message Producers ▹ Message Consumers
  • 24. 24 JMS API Programming Model Cont. hSenid Lanka: JMS ▸Message Producer ▹ A JMS message producer object is created by a session. ▹ It is used for sending messages to a destination. ▸Message Consumer ▹ A JMS message consumer object is created by session. ▹ It helps for receiving messages sent to a destination.
  • 25. 25 DEMO (JMS Pure Java) hSenid Lanka: JMS Download project files
  • 26. 26 Spring JMS hSenid Lanka: JMS ▸Advantages ▹ No EJB container required (no JEE container) ▹ Simplified resource management ▹ Connection Factory, Connections, Destinations ▹ Simplified concurrency management ▹ Simplified transaction management
  • 27. 27 Spring JMS Cont. hSenid Lanka: JMS ▸JMS Template ▹ Send and receive messages synchronously ▸Message Listener Container ▹ Receive messages asynchronously ▹ Message-Driven POJOs (MDPs)
  • 28. 28 JMSTemplate hSenid Lanka: JMS Method Description browse() Browse messages in a queue convertAndSend() Send messages synchronously Convert a Java object to a JMS message execute() Provides access to callbacks for more complex scenarios receive() receiveAndConvert() Receive messages synchronously receiveSelected() receiveSelectedAndConvert() Receive filtered messages synchronously send() Send a message synchronously using a MessageCreator
  • 29. 29 hSenid Lanka: JMS DEMO (Spring JMS) Download project files
  • 30. 30hSenid Lanka: Java Message Service By Kasun Dinesh Madusanke THANK YOU!