InfoCenter Home >
4: Developing applications >
4.6: Java Technologies >
4.6.3: Java Message Service (JMS) overview

4.6.3: Java Message Service (JMS) overview

IBM WebSphere Application Server supports messaging as a method of communication based on the Java Message Service programming interface.

Unlike JavaMail that enables communication initiated by people or by software components to people, Java Message Service (or JMS) only provides communication between software components and applications. Communication provided by JMS is loosely coupled, which means the sender and receiver do not have to be active or aware of each other. The communication is also asynchronous. This means clients do not have to request messages from the JMS provider in order to receive them, and software components can send messages to other components without stopping their processes to wait for a response.

In this peer-to-peer communication system, each client connects to a messaging agent that provides the framework for sending and receiving messages. The client is required to know only the following:

  • message format
  • destination of the message

There are two approaches to messaging:

The point-to-point messaging approach uses such facilities as message queues, senders (or message producers), and receivers (or message consumers). Clients send messages that are destined for a specific receiver to a unique queue. When the receiving client extracts a message from the specific queue, it sends an acknowledgement indicating the message was processed. Queues hold all messages until the messages are received or until they expire.

The publish/subscribe messaging approach uses the concepts of publishers, subscribers, and topics. Clients send messages to a topic or a content hierarchy. In order to receive the message, the message consumers must subscribe to that topic. So, in this approach, the message producers are known as publishers and the message consumers are known as subscribers. The JMS provider distributes the messages sent from the multiple publishers to the topic, to the multiple subscribers of that topic.

The MQSeries product is the default JMS provider for WebSphere Application Server. The MQSeries administration tool, JMSAdmin, is used to bind JMS objects (connection factories and destinations) into the namespace, and to set their properties.

WebSphere Application Server Enterprise Edition Version 4.0 also provides the JMS Listener function. Similar to an event listener, the JMS Listener enables WebSphere Application Server to react to anonymous, incoming JMS messages by invoking an appropriate enterprise java bean. The invoked enterprise bean is a stateless session bean with an onMessage() method.

Go to previous article: JNDI Name Space Dump utility Go to next article: Using the JMS point-to-point messaging approach

 

 
Go to previous article: JNDI Name Space Dump utility Go to next article: Using the JMS point-to-point messaging approach