1
CASCO N 2002
Introduction to Messaging using JMS
Evan Mamas emamas@ca.ibm.com IBM Toronto Lab CASCO N 2002
Outline
Basic Concepts API Architecture API Programming Model Advanced features Integration with J2EE Simple applications References
CASCO N 2002 CASCO N 2002 Outline Basic Concepts API - - PDF document
Introduction to Messaging using JMS Evan Mamas emamas@ca.ibm.com IBM Toronto Lab CASCO N 2002 CASCO N 2002 Outline Basic Concepts API Architecture API Programming Model Advanced features Integration with J2EE Simple
Basic Concepts API Architecture API Programming Model Advanced features Integration with J2EE Simple applications References
“Method of communication between software
Point to Point
Loosely coupled
Standard API for messaging
Support for distributed transactions Integration with J2EE
Latest spec version is 1.1
JMS vs. Vendor Specific APIs
JMS vs. RPC
Architecture
Messaging domains
Message consumption
JMS Provider
JMS Client
Messages
Administered Objects
Native Clients
Message queue, sender, receiver Clients must know which queue to use Queue retains the message until
One consumer per message No timing dependencies
Topic based
Publishers and subscribers are anonymous Messages are retained as long as necessary to
One message multiple consumers Timing constraints
Synchronous
Asynchronous
Administered Objects Connections Sessions Message Producers Message Consumers Messages
Configured by the administrator Usually looked up through JNDI Connection Factories
Destination Factories
A virtual connection with a JMS provider Queue or Topic connections are created using the
start needs to be called before messages can be
close needs to be called to release resources stop can be used to temporarily stop message
Single threaded context for consuming/producing
Sessions are used to create message consumers,
Sessions provide a context to group as one
QueueSession and TopicSession Can be transactional (local) Can provide acknowledgment
Send messages to a destination Unidentified producers can be used when
QueueSender interface
TopicPublisher interface
Receives messages sent to a destination Message Receivers
Message Listeners
Message Selectors
Header
Properties (optional) Body (optional)
Acknowledgment
Persistence Priority
Expiration Temporary destinations
Durable subscriptions Local transactions
Distributed transactions