Science Fair Project Encyclopedia
Java Message Service
- point-to-point or queuing model
- publish/subscribe model
In the point-to-point or queuing model, a producer posts messages to a particular queue and a consumer reads messages from the queue. Here, the producer knows the destination of the message and posts the message directly to the consumer's queue. It is characterized by following:
- Only one consumer will get the message
- The receiver can consume the message after the producer stopped running. Neither the receiver has to be running at the time the message have been sent.
- Every successful processing of a message is acknowledged by the receiver
The publish/subscribe model supports publishing messages to a particular message topic. Zero or more subscribers may register interest in receiving messages on a particular message topic. In this model, neither the publisher nor the subscriber know about each other. A good metaphor for it is anonymous bulletin board. There are following characteristics for this model:
- Multiple consumers can get the message
- There is a timing dependency between publishers and subscribers. Publisher has to create a subscription in order for clients to be able to subscribe. And subscriber has to remain continuously active to receive messages.
Using Java, JMS provides a way of separating the application from the transport layer of providing data. The same Java classes can be used to communicate with different JMS Providers by accessing the JNDI information for the desired provider. The classes first use a Connection Factory to connect to the queue or topic, and then use populate and send or publish the messages. On the receiving side, the clients then receive or subscribe to the messages.
In order to use JMS, one must have a JMS provider that can manage the sessions and queues. There are open source as well as proprietary providers, including:
- Websphere/MQ from IBM
- SonicMQ from Sonic Software
- BEA WebLogic Server JMS from BEA Systems
- JMS+ from webMethods - http://www.webmethods.com/
- Joram from Joram - http://joram.objectweb.org/
- SwiftMQ from SwiftMQ
- IONA JMS from IONA Technologies
- iBus from Softwired
- GigaSpaces from GigaSpaces Technologies http://www.gigaspaces.com
- ActiveMQ http://activemq.codehaus.org
If you plan to run your application in a server cluster , you should check with provider if their implementation supports load balancing and/or failover..
- Sun's JMS Overview
- JMS messaging articles, tutorials, and open source projects
- GigaSpaces Technologies JavaSpaces approach to JMS
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details