InfoCenter Home > 4.6.3.1: Using the JMS point-to-point messaging approachThis article describes the point-to-point messaging approach using WebSphere Application Server's default JMS provider, MQSeries. The MQSeries messaging server implements point-to-point communication. To enable the MQSeries point-to-point messaging support, you need:
MQSeries can now act as a resource manager in application transactions, and WebSphere Application Server can act as the transaction coordinator. For example, when a client application sends a request, WebSphere Application Server, using MQSeries, puts the message on an out queue and waits for a response to return to the in queue. In this scenario, there is no guarantee the message was sent, or that the receiver received the message. These types of messages are known as non persistent messages. The point-to-point messaging approach in WebSphere Application Server and MQSeries is illustrated in the following graphic:
Message delivery can be defined as:
Message delivery properties can be set:
To define a queue in the JNDI namespace and to set the persistence properties for the queue, enter the following command in the MQSeries JMSAdmin tool: InitCtx> DEFINE Q(TESTQ) PERSISTENCE(xxx)Where xxx is one of the following:
If your application sends a message and requires a reply, set a reasonable timeout value in your application to handle a delayed or "no" reply situation. The following application code waits for a maximum of 5000 milliseconds: Message inMessage = queueReceiver.receive(5000);Set a similar timeout in your reply message. Transactions to MQSeries are boundary transactions not end-to-end transactions. This means that only a put to a queue, or a get from a queue is part of the transaction. The flow to a remote application is not part of the transaction. In order to guarantee the message is received by the remote application, define that message in the JMSAdmin tool as a persistent message. WebSphere enterprise applications can use the JMS Listener function to automatically receive messages from input queues (JMS destinations) and to coordinate the processing of those messages. This enables automatic asynchronous delivery of messages to an enterprise application, instead of the application having to explicitly poll for messages on the queue. For more information on the JMS Listener function, see An overview of the JMS Listener.
See the Support of the MQSeries Java Message Service resources article for configuration information. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|