Transcript JMS


JMS
Aino Andriessen

Nov 29, 2005
1
Messaging

 a-synchrone communicatie
 Publish-Subscribe Messaging
 Point-To-Point Messaging

Nov 29, 2005
2
Point to Point

 Queue

Nov 29, 2005
3
Publish - Subscribe

 Topic
 (non) durable

Nov 29, 2005
4
JMS

 javax.jms
 verzameling interfaces






Connection
Session
MessageListener
MessageConsumer en Producer
Queue
Topic
 Implementatie is dus nodig
 IBM MQ,Tibco,Sonic, ActiveMQ, Oracle AQ, ...
 Vaak als EJB
 Message Driven Bean (MDB)

Nov 29, 2005
5
Architectuur


Nov 29, 2005
6
JMS - Primary features

The primary features of JMS are as follows:
 Connection Factories are used in JMS to create
connections to a specific JMS provider.
 In JMS, both Publish-Subscribe Messaging and
Point-To-Point are implemented and defined by
separate interfaces so that a Provider does not have
to support both.
 JMS defines the concept of a Topic or a Queue as
the target for a Message. Topics are used for
Publish-Subscribe Messaging. Queues are used for
Point-to-Point Messaging.
 The Providers’ code is defined by interfaces in JMS,
freeing the implementation from the limitations of
subclassing.
 JMS provides support for distributed transactions.

Nov 29, 2005
7
Demo

Laptop
consumer
Suse VM
Message
Listener
ActiveMQ
(14-318-962:61616)
producer
jms
api
jms
api

Nov 29, 2005
TEST.FOO
8
'poor man messaging'

 java.util.Queue

Nov 29, 2005
9
More info

 http://java.sun.com/products/jms/tutorial/
 http://my.execpc.com/~gopalan/jms/jms.html
 http://www.javaskyline.com/learnjms.html

Nov 29, 2005
10