SlideShare a Scribd company logo
1 of 38
M
D 1
Java Messaging Service (JMS)
M
D 2
Objectives
• Understand strategies for computer-to-computer messaging
• Understand how vendors attempt to lock-in customers using proprietary
communication APIs
• Understand why the Java Messaging Service (JMS) is becoming the
de-facto vendor-neutral messaging interface between J2EE systems
and how JMS helps avoid vendor lock-in
• Understand the differences between messaging systems
• Understand how messaging systems interoperate
• Understand how JMS fits in with other EAI architectures such as Web
Services, SOA, ESB, Multi-tier architectures, J2EE Architecture, JCA,
Microsoft BizTalk, RosettaNet
• Understand how future systems will interoperate
• Review references
M
D 3
Messaging Strategy Overview
1. Support cost effective reliable messaging
between state law enforcement agencies
2. Allow messages to have guaranteed
delivery and be fully encrypted
3. Avoid vendor-specific APIs
4. Integrate with search and workflow
5. Be flexible for future standards
6. Make it easy for developers to use
M
D 4
Vendor Lock-In
• Definition: When you spend a lot of time and money
building your products around a specific vendor's
solution.
• Vendor lock-in prevents you from moving your
application to another vendor or an open-source
solution
– Vendor lock-in is Bad
– Portability between vendors is Good
• Successful Enterprise Architecture Strategies attempt
to minimize dependencies on any product due to:
– Excessive licensing fees
– Excessive support fees
– Vendor support for a specific product
– Vendor stability
M
D 5
Application Portability
• To promote portability and
prevent vendor lock-in,
whenever there is a choice
between a vendor-neutral-
industry-standard service
interface and a vendor
specific interface, always use
the vendor-neutral standard
unless you have a
BUSINESS REASON to use
the vendor specific interface
Application
Service
Vendor
Neutral
Service
Interface
Vendor
Specific
Service
Interface
M
D 6
What is A Message?
• A communication between two things
(people, computers)
• Typical questions:
– Who was the message from?
– What is the destination?
– Was the message actually received by the
recipient?
– Was it understood? (what restaurant?, 8am
or 8pm?)
– Should it be acknowledged?
– Could it have been tampered with in transit?
– Who really sent it?
Joe,
Lets meet for lunch atthe restaurant at 8.
- John
M
D 7
Definition
Messaging: a method of communication
between software components or
applications
– E-mail is also messaging but it is person to
person
– In this tutorial, messaging is computer to
computer
M
D 8
Messaging System
• A Messaging System is a peer-to-peer facility to allow any
number computer applications to communicate with each
other
• A messaging application can send messages to, and receive
messages from, any other application
• Each client connects to a messaging interface that provides
facilities for creating, sending, receiving, and reading
messages.
Application
Interface
Application
Interface
M
D 9
Messaging Clients
• A Messaging Client is a system that handles the
communication between the application interface and the
physical network
• A client can be either an open-source product or a
commercial product
• Clients deal with issues such as how to send a message
over an unreliable network
Application
Interface
Application
Interface
Client Client
M
D 10
Store and Forward
• Messaging clients deal with issues such as how to send a
message over an unreliable network with guaranteed
security once-and only-once-delivery so that messages can
be part of reliable distributed transactions (ACID)
Application
Interface
Application
Interface
Client Client
Message
Server
Store &
Forward
Message
Server
Store &
Forward
Unreliable
Network
Unreliable
Network
M
D 11
Java Transaction API
• Java Transactions are handled by the Java
Transaction API (JTA)
• The JTA makes it easy for Java
programmers to do complex transactions
involving data on multiple J2EE systems
located over a wide area network (WAN)
• JTA depends on Messages Beans (MBean)
and therefore JMS
• JTA makes ACID transactions possible
M
D 12
ACID Test
• Atomicity – all or nothing – a transaction either
completely succeeds or it completely fails –
nothing in between
• Consistency – meet constraints of endpoints such
as non-duplicate ID numbers
• Isolation – each transaction has a consistent view
of the world
• Durability – once committed the transaction will
endure regardless of single component failure
M
D 13
A Wire Protocol
• A wire protocol is an agreed upon standard
between two systems (potentially built with
different technologies) that defines how
they will communicate with each other
Format of messages "on the wire"
Examples: HTTP (web), SMTP (mail), SNMP (monitoring) and SOAP
M
D 14
System Coupling
• TIGHT: Systems that are
very rigid in their
requirements
• System 2 MUST respond to
a message before System 1
can proceed to the next
activity
• LOOSE: Where
programmers just send a
message and can be assure
the infrastructure will do
whatever it needs to do
send the message
System 1 System 2
System 1 System 2
Tight Coupling
Loose Coupling
M
D 15
Tightly Coupled Communications
• Sender needs a remote service and calls a remote procedure call
• The sending process “Stops” and waits for a reply
• Synchronous messaging – don’t proceed till we are synchronized up
• The sender will “freeze” if the network is down or the sender will have to
manually keep trying till the remote system is up and it gets a response
• Remote procedure call (RPC), Java Remote Method Invocation (RMI)
System 1
Unreliable
Network
Unreliable
Network
System 2
M
D 16
Loosely Coupled Communications
• Programmers just “fire and forget”
• There is no “blocking” of sender’s process
• System 1 just gets a reply message when the data request has been received
• System can transmit messages to remote systems even when the remote system is down or
the network has failed. Messages wait patiently in the queue till the network is back up.
• System administrators can monitor the message queues and be notified of congestions
• High priority messages can take precedence over large, batch transfers
System 1
Unreliable
Network
Unreliable
Network
System 2
Message
Queue
Message
Queue
M
D 17
Application Program Interface (API)
• A formal set of interfaces definitions used by programmers
• Usually a specified in SPECIFIC language such as Java or C
• Java Messaging Service (JMS) is an API
• JMS was designed to be a wrapper API around existing
messaging systems
J2EE
Application
(JMS Client)
JMS Provider
JMS API
J2EE
Application
(JMS Client)
JMS Provider
JMS API
Messaging System
M
D 18
APIs Promote Portability
• Applications DO
NOT call an vendor
interface directly
• Applications call
the industry
standard and let the
transport
mechanism move
the data
Sun Certified J2EE 1.3+
Application Server
JMS Interface
Application
Transport Mechanism
Vendor Interface
M
D 19
JMS is part of J2EE
• In order to be a Sun-
certified J2EE 1.3+
compliant, the application
server MUST support the
JMS interface (1.2 was
only recommended)
• Any object can use the
JMS API
• JMS is THE default
application server
messaging interface
Sun Certified J2EE 1.3+
Application Server
JMS Interface
Transport Mechanism
Application
M
D 20
JMS Details
• JMS is a Messaging API Specification
• Published and maintained by Sun
Microsystems
• First published in August 1998.
• Latest version is Version 1.0.2b
• See http://java.sun.com/products/jms/
M
D 21
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
M
D 22
Benefits of JMS
• Simplifies enterprise development
• Allows loosely coupled systems (systems
that don't block each other)
• Provides reliable messaging over an
unreliable network
• Promotes secure messaging between
systems
• Messages between JMS systems can be
encrypted
M
D
When to Use a JMS Interface?
• 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
M
D 24
Asynchronous Messaging
• Ways that objects
communicate
• A service of the
underlying operating
system
• Allows programmers to
“fire and forget”
M
D
Message Brokers
Use of a broker will reduce these integration costs
by one-third. During maintenance, when a single
change to an application can have a rippling effect
on several to several dozen interfaces, use of a
broker can reduce costs by two-thirds.“
- Gartner Group
M
D
Messaging Benefits
• Messaging infrastructure guarantees reliable
delivery of a message
• Once and only once delivery
• Messages can have different priority
• Transactional control
• Transactions can be grouped together
• Support of “undo” – reversible operations
M
D
Similar to E-mail
Header:Header:
To: From: Subject:
Priority: Urgent
To: From: Subject:
Priority: Urgent
BodyBody
Recipients
e-Mail
Server
Outgoing
Mail
Server
M
D
When we send e-mail…
• Sender sends a message to the outgoing e-
mail server using a standard format ( e.g.
Simple Mail Transfer Protocol)
• Message is routed to receiver’s e-mail
server
• Message stored in e-mail server till the
receiver picks up the message
• Example of asynchronous processing
M
D
Message Structure
HeaderHeader
PropertiesProperties
BodyBody
M
D
Object to Object Messaging
HeaderHeader
PropertiesProperties
BodyBody
Message
Queue
M
D
Header
• Identify message
• Destination
• Routing Information
• Priority
• Timestamp
• Reply to
• Message type
HeaderHeader
PropertiesProperties
BodyBody
M
D
Properties
• Added by the application
developer
• Application specific
properties
• Key-value pairs
– KEYWORD=VALUE
• Extensions for messaging
systems
HeaderHeader
PropertiesProperties
BodyBody
M
D
Body
• Message body
• Can contain arbitrary data
types
– Text messages
– Map (key-value pairs)
– XML
– Serialized objects (Java)
– Binary data
– Empty
HeaderHeader
PropertiesProperties
BodyBody
M
D
Message Example
To: My Enterprise Service BusTo: My Enterprise Service Bus
TransactionNumber=12345TransactionNumber=12345
<?xml version="1.0"?>
<RequestedAction>Person Search</RequestedAction>
<Person>
<PersonSurName>Jones</PersonSurName>
<PersonGivenName>Sam</PersonGivenName>
<PersonBirthDate>1980-12-31</PersonBirthDate>
</Person>
<?xml version="1.0"?>
<RequestedAction>Person Search</RequestedAction>
<Person>
<PersonSurName>Jones</PersonSurName>
<PersonGivenName>Sam</PersonGivenName>
<PersonBirthDate>1980-12-31</PersonBirthDate>
</Person>
M
D
JMS Modes
• One-to-one (aka Point-to-point)
– Send a message to a JMS Queue
– One message reader
• One-to-Many (aka Publish-subscribe)
– Send (publish) message to a JMS Topic
– Enables many readers (subscribers)
– Also enables many-to-many subscription
Queue
Message
Receiver
Sender
Topic
Message
Subscriber
Sender
Subscriber
M
D 36
Required Header Types
• Automatic – automatically put in EVERY
message by the system
• Developer-Assigned – required headers that
must be set before a send()
M
D 37
Automatic Header Information
• Destination – where to send the message (either a
queue or a topic)
• DeliveryMode – reliable or not
• MessageID – number that identifies the message
• Timestamp – date and time that send() was called
• Expiration – time to live in milliseconds – by
default is does not expire
• Redelivered – not the first try
• Priority – Should this message be expedited?
M
D 38
Priority Messages
• The JMS API defines ten levels of priority
value
• 0 as the lowest priority
• 9 as the highest
• 0-4 are gradations of normal priority and
priorities
• 5-9 are gradations of expedited priority

More Related Content

What's hot

Client server-computing
Client server-computingClient server-computing
Client server-computingjayasreep3
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingPeter R. Egli
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middlewaresanjoysanyal
 
Cs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaCs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaDebasis Das
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitivesStudent
 
Cs556 section2
Cs556 section2Cs556 section2
Cs556 section2farshad33
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 
client server protocol
client server protocolclient server protocol
client server protocolbmuhire
 
Java Message Service
Java Message ServiceJava Message Service
Java Message ServiceAMIT YADAV
 
The Middleware technology that connects the enterprise
The Middleware technology that connects the enterpriseThe Middleware technology that connects the enterprise
The Middleware technology that connects the enterprise Kasun Indrasiri
 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jmsSridhar Reddy
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed systemGd Goenka University
 
Impact of network quality deterioration on user’s perceived operability and l...
Impact of network quality deterioration on user’s perceived operability and l...Impact of network quality deterioration on user’s perceived operability and l...
Impact of network quality deterioration on user’s perceived operability and l...IJCNCJournal
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed SystemsDilum Bandara
 
Introduction to Message-Oriented Middleware
Introduction to Message-Oriented MiddlewareIntroduction to Message-Oriented Middleware
Introduction to Message-Oriented MiddlewareEdward Curry
 
Mobile Computing Architecture
Mobile Computing ArchitectureMobile Computing Architecture
Mobile Computing ArchitectureTrinity Dwarka
 

What's hot (20)

Middleware Technologies ppt
Middleware Technologies pptMiddleware Technologies ppt
Middleware Technologies ppt
 
Client server-computing
Client server-computingClient server-computing
Client server-computing
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
 
Cs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaCs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1funda
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 
Cs556 section2
Cs556 section2Cs556 section2
Cs556 section2
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
client server protocol
client server protocolclient server protocol
client server protocol
 
Java Message Service
Java Message ServiceJava Message Service
Java Message Service
 
The Middleware technology that connects the enterprise
The Middleware technology that connects the enterpriseThe Middleware technology that connects the enterprise
The Middleware technology that connects the enterprise
 
Distributed system
Distributed systemDistributed system
Distributed system
 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed system
 
Impact of network quality deterioration on user’s perceived operability and l...
Impact of network quality deterioration on user’s perceived operability and l...Impact of network quality deterioration on user’s perceived operability and l...
Impact of network quality deterioration on user’s perceived operability and l...
 
Clientserver
ClientserverClientserver
Clientserver
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
 
5. Distributed Operating Systems
5. Distributed Operating Systems5. Distributed Operating Systems
5. Distributed Operating Systems
 
Introduction to Message-Oriented Middleware
Introduction to Message-Oriented MiddlewareIntroduction to Message-Oriented Middleware
Introduction to Message-Oriented Middleware
 
Mobile Computing Architecture
Mobile Computing ArchitectureMobile Computing Architecture
Mobile Computing Architecture
 

Similar to Jms intro

Manish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareManish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareA P
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsAya Mahmoud
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architectureraksharao
 
MQTT - Shyam.pptx
MQTT - Shyam.pptxMQTT - Shyam.pptx
MQTT - Shyam.pptxshyamsasi94
 
Connecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseConnecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseAndrew Schofield
 
Realtime mobile&iot solutions using mqtt and message sight
Realtime mobile&iot solutions using mqtt and message sightRealtime mobile&iot solutions using mqtt and message sight
Realtime mobile&iot solutions using mqtt and message sightfloridawusergroup
 
IBM MessageSight for mobile and the internet of things
IBM MessageSight for mobile and the internet of thingsIBM MessageSight for mobile and the internet of things
IBM MessageSight for mobile and the internet of thingsJohn Samuel
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Chapter 2 computer network PPT CN-1.pptx
Chapter 2 computer network PPT CN-1.pptxChapter 2 computer network PPT CN-1.pptx
Chapter 2 computer network PPT CN-1.pptxManasaPM3
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented MiddlewarePeter R. Egli
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process CommunicationAbhishek Sagar
 
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...Redis Labs
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed ComputingAbhishek Jaisingh
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance SHIKHA GAUTAM
 
A Deep Dive in the World of IT Networking (Part 2)
A Deep Dive in the World of IT Networking (Part 2)A Deep Dive in the World of IT Networking (Part 2)
A Deep Dive in the World of IT Networking (Part 2)Tuan Yang
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
 

Similar to Jms intro (20)

Manish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareManish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middleware
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Viloria osi layer4-7
Viloria osi layer4-7Viloria osi layer4-7
Viloria osi layer4-7
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architecture
 
MQTT - Shyam.pptx
MQTT - Shyam.pptxMQTT - Shyam.pptx
MQTT - Shyam.pptx
 
Connecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseConnecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the Enterprise
 
Realtime mobile&iot solutions using mqtt and message sight
Realtime mobile&iot solutions using mqtt and message sightRealtime mobile&iot solutions using mqtt and message sight
Realtime mobile&iot solutions using mqtt and message sight
 
Mq Lecture
Mq LectureMq Lecture
Mq Lecture
 
IBM MessageSight for mobile and the internet of things
IBM MessageSight for mobile and the internet of thingsIBM MessageSight for mobile and the internet of things
IBM MessageSight for mobile and the internet of things
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Chapter 2 computer network PPT CN-1.pptx
Chapter 2 computer network PPT CN-1.pptxChapter 2 computer network PPT CN-1.pptx
Chapter 2 computer network PPT CN-1.pptx
 
Iso model
Iso modelIso model
Iso model
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
 
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
 
A Deep Dive in the World of IT Networking (Part 2)
A Deep Dive in the World of IT Networking (Part 2)A Deep Dive in the World of IT Networking (Part 2)
A Deep Dive in the World of IT Networking (Part 2)
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
 

More from Rajeev Kumar

More from Rajeev Kumar (9)

Db performance optimization with indexing
Db performance optimization with indexingDb performance optimization with indexing
Db performance optimization with indexing
 
Javasession10
Javasession10Javasession10
Javasession10
 
Javasession8
Javasession8Javasession8
Javasession8
 
Javasession6
Javasession6Javasession6
Javasession6
 
Javasession7
Javasession7Javasession7
Javasession7
 
Javasession5
Javasession5Javasession5
Javasession5
 
Javasession4
Javasession4Javasession4
Javasession4
 
Java session 3
Java session 3Java session 3
Java session 3
 
Java session2
Java session2Java session2
Java session2
 

Recently uploaded

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 

Recently uploaded (20)

Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 

Jms intro

  • 1. M D 1 Java Messaging Service (JMS)
  • 2. M D 2 Objectives • Understand strategies for computer-to-computer messaging • Understand how vendors attempt to lock-in customers using proprietary communication APIs • Understand why the Java Messaging Service (JMS) is becoming the de-facto vendor-neutral messaging interface between J2EE systems and how JMS helps avoid vendor lock-in • Understand the differences between messaging systems • Understand how messaging systems interoperate • Understand how JMS fits in with other EAI architectures such as Web Services, SOA, ESB, Multi-tier architectures, J2EE Architecture, JCA, Microsoft BizTalk, RosettaNet • Understand how future systems will interoperate • Review references
  • 3. M D 3 Messaging Strategy Overview 1. Support cost effective reliable messaging between state law enforcement agencies 2. Allow messages to have guaranteed delivery and be fully encrypted 3. Avoid vendor-specific APIs 4. Integrate with search and workflow 5. Be flexible for future standards 6. Make it easy for developers to use
  • 4. M D 4 Vendor Lock-In • Definition: When you spend a lot of time and money building your products around a specific vendor's solution. • Vendor lock-in prevents you from moving your application to another vendor or an open-source solution – Vendor lock-in is Bad – Portability between vendors is Good • Successful Enterprise Architecture Strategies attempt to minimize dependencies on any product due to: – Excessive licensing fees – Excessive support fees – Vendor support for a specific product – Vendor stability
  • 5. M D 5 Application Portability • To promote portability and prevent vendor lock-in, whenever there is a choice between a vendor-neutral- industry-standard service interface and a vendor specific interface, always use the vendor-neutral standard unless you have a BUSINESS REASON to use the vendor specific interface Application Service Vendor Neutral Service Interface Vendor Specific Service Interface
  • 6. M D 6 What is A Message? • A communication between two things (people, computers) • Typical questions: – Who was the message from? – What is the destination? – Was the message actually received by the recipient? – Was it understood? (what restaurant?, 8am or 8pm?) – Should it be acknowledged? – Could it have been tampered with in transit? – Who really sent it? Joe, Lets meet for lunch atthe restaurant at 8. - John
  • 7. M D 7 Definition Messaging: a method of communication between software components or applications – E-mail is also messaging but it is person to person – In this tutorial, messaging is computer to computer
  • 8. M D 8 Messaging System • A Messaging System is a peer-to-peer facility to allow any number computer applications to communicate with each other • A messaging application can send messages to, and receive messages from, any other application • Each client connects to a messaging interface that provides facilities for creating, sending, receiving, and reading messages. Application Interface Application Interface
  • 9. M D 9 Messaging Clients • A Messaging Client is a system that handles the communication between the application interface and the physical network • A client can be either an open-source product or a commercial product • Clients deal with issues such as how to send a message over an unreliable network Application Interface Application Interface Client Client
  • 10. M D 10 Store and Forward • Messaging clients deal with issues such as how to send a message over an unreliable network with guaranteed security once-and only-once-delivery so that messages can be part of reliable distributed transactions (ACID) Application Interface Application Interface Client Client Message Server Store & Forward Message Server Store & Forward Unreliable Network Unreliable Network
  • 11. M D 11 Java Transaction API • Java Transactions are handled by the Java Transaction API (JTA) • The JTA makes it easy for Java programmers to do complex transactions involving data on multiple J2EE systems located over a wide area network (WAN) • JTA depends on Messages Beans (MBean) and therefore JMS • JTA makes ACID transactions possible
  • 12. M D 12 ACID Test • Atomicity – all or nothing – a transaction either completely succeeds or it completely fails – nothing in between • Consistency – meet constraints of endpoints such as non-duplicate ID numbers • Isolation – each transaction has a consistent view of the world • Durability – once committed the transaction will endure regardless of single component failure
  • 13. M D 13 A Wire Protocol • A wire protocol is an agreed upon standard between two systems (potentially built with different technologies) that defines how they will communicate with each other Format of messages "on the wire" Examples: HTTP (web), SMTP (mail), SNMP (monitoring) and SOAP
  • 14. M D 14 System Coupling • TIGHT: Systems that are very rigid in their requirements • System 2 MUST respond to a message before System 1 can proceed to the next activity • LOOSE: Where programmers just send a message and can be assure the infrastructure will do whatever it needs to do send the message System 1 System 2 System 1 System 2 Tight Coupling Loose Coupling
  • 15. M D 15 Tightly Coupled Communications • Sender needs a remote service and calls a remote procedure call • The sending process “Stops” and waits for a reply • Synchronous messaging – don’t proceed till we are synchronized up • The sender will “freeze” if the network is down or the sender will have to manually keep trying till the remote system is up and it gets a response • Remote procedure call (RPC), Java Remote Method Invocation (RMI) System 1 Unreliable Network Unreliable Network System 2
  • 16. M D 16 Loosely Coupled Communications • Programmers just “fire and forget” • There is no “blocking” of sender’s process • System 1 just gets a reply message when the data request has been received • System can transmit messages to remote systems even when the remote system is down or the network has failed. Messages wait patiently in the queue till the network is back up. • System administrators can monitor the message queues and be notified of congestions • High priority messages can take precedence over large, batch transfers System 1 Unreliable Network Unreliable Network System 2 Message Queue Message Queue
  • 17. M D 17 Application Program Interface (API) • A formal set of interfaces definitions used by programmers • Usually a specified in SPECIFIC language such as Java or C • Java Messaging Service (JMS) is an API • JMS was designed to be a wrapper API around existing messaging systems J2EE Application (JMS Client) JMS Provider JMS API J2EE Application (JMS Client) JMS Provider JMS API Messaging System
  • 18. M D 18 APIs Promote Portability • Applications DO NOT call an vendor interface directly • Applications call the industry standard and let the transport mechanism move the data Sun Certified J2EE 1.3+ Application Server JMS Interface Application Transport Mechanism Vendor Interface
  • 19. M D 19 JMS is part of J2EE • In order to be a Sun- certified J2EE 1.3+ compliant, the application server MUST support the JMS interface (1.2 was only recommended) • Any object can use the JMS API • JMS is THE default application server messaging interface Sun Certified J2EE 1.3+ Application Server JMS Interface Transport Mechanism Application
  • 20. M D 20 JMS Details • JMS is a Messaging API Specification • Published and maintained by Sun Microsystems • First published in August 1998. • Latest version is Version 1.0.2b • See http://java.sun.com/products/jms/
  • 21. M D 21 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
  • 22. M D 22 Benefits of JMS • Simplifies enterprise development • Allows loosely coupled systems (systems that don't block each other) • Provides reliable messaging over an unreliable network • Promotes secure messaging between systems • Messages between JMS systems can be encrypted
  • 23. M D When to Use a JMS Interface? • 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
  • 24. M D 24 Asynchronous Messaging • Ways that objects communicate • A service of the underlying operating system • Allows programmers to “fire and forget”
  • 25. M D Message Brokers Use of a broker will reduce these integration costs by one-third. During maintenance, when a single change to an application can have a rippling effect on several to several dozen interfaces, use of a broker can reduce costs by two-thirds.“ - Gartner Group
  • 26. M D Messaging Benefits • Messaging infrastructure guarantees reliable delivery of a message • Once and only once delivery • Messages can have different priority • Transactional control • Transactions can be grouped together • Support of “undo” – reversible operations
  • 27. M D Similar to E-mail Header:Header: To: From: Subject: Priority: Urgent To: From: Subject: Priority: Urgent BodyBody Recipients e-Mail Server Outgoing Mail Server
  • 28. M D When we send e-mail… • Sender sends a message to the outgoing e- mail server using a standard format ( e.g. Simple Mail Transfer Protocol) • Message is routed to receiver’s e-mail server • Message stored in e-mail server till the receiver picks up the message • Example of asynchronous processing
  • 30. M D Object to Object Messaging HeaderHeader PropertiesProperties BodyBody Message Queue
  • 31. M D Header • Identify message • Destination • Routing Information • Priority • Timestamp • Reply to • Message type HeaderHeader PropertiesProperties BodyBody
  • 32. M D Properties • Added by the application developer • Application specific properties • Key-value pairs – KEYWORD=VALUE • Extensions for messaging systems HeaderHeader PropertiesProperties BodyBody
  • 33. M D Body • Message body • Can contain arbitrary data types – Text messages – Map (key-value pairs) – XML – Serialized objects (Java) – Binary data – Empty HeaderHeader PropertiesProperties BodyBody
  • 34. M D Message Example To: My Enterprise Service BusTo: My Enterprise Service Bus TransactionNumber=12345TransactionNumber=12345 <?xml version="1.0"?> <RequestedAction>Person Search</RequestedAction> <Person> <PersonSurName>Jones</PersonSurName> <PersonGivenName>Sam</PersonGivenName> <PersonBirthDate>1980-12-31</PersonBirthDate> </Person> <?xml version="1.0"?> <RequestedAction>Person Search</RequestedAction> <Person> <PersonSurName>Jones</PersonSurName> <PersonGivenName>Sam</PersonGivenName> <PersonBirthDate>1980-12-31</PersonBirthDate> </Person>
  • 35. M D JMS Modes • One-to-one (aka Point-to-point) – Send a message to a JMS Queue – One message reader • One-to-Many (aka Publish-subscribe) – Send (publish) message to a JMS Topic – Enables many readers (subscribers) – Also enables many-to-many subscription Queue Message Receiver Sender Topic Message Subscriber Sender Subscriber
  • 36. M D 36 Required Header Types • Automatic – automatically put in EVERY message by the system • Developer-Assigned – required headers that must be set before a send()
  • 37. M D 37 Automatic Header Information • Destination – where to send the message (either a queue or a topic) • DeliveryMode – reliable or not • MessageID – number that identifies the message • Timestamp – date and time that send() was called • Expiration – time to live in milliseconds – by default is does not expire • Redelivered – not the first try • Priority – Should this message be expedited?
  • 38. M D 38 Priority Messages • The JMS API defines ten levels of priority value • 0 as the lowest priority • 9 as the highest • 0-4 are gradations of normal priority and priorities • 5-9 are gradations of expedited priority