A sample tutorial is as follows:
- The JMS application receives a request from a mobile device.
- The JMS application opens a response queue (which can be dynamic).
- The JMS application prepares a message indicating the destination from # 2 as the JMSREplyTo address.
- The JMS application sends a request outside the synchronization point to an external service provider.
- The JMS application listens for a response with a specified wait interval. If he used a dynamic response queue, he performs a simple reception. If multiple instances are listening on the same queue (which is more likely with an external service), then it uses the JMSMessageID returned from send as the JMSCorrelationID specified in the receive.
- The JMS application receives a response from an external service.
- The JMS application is responding to a mobile device.
Note that using WMQ, the expected behavior of the service provider is to copy the JMSMessageID from the request message to the JMSCorrelationID of the response. Less often, the sender needs to generate a JMSCorrelation identifier and copy it into the JMSCorrelationID of the response, but some applications use this behavior. You will need to understand how your service provider handles this to determine the correct behavior of your requester application.
If you use the full installation of the WMQ client, you will already have sample code that will execute most of this. If it is installed by default, look ...
C:\Program Files\IBM\Websphere MQ\tools\jms\samples\simple\simpleRequestor.java
... or an equivalent location in the /var/mqm for UNIX / Linux distributions. This is one of many reasons to install a full client, and not just capture jar files. If you need to download the client, it comes as SupportPac MQC7 .
T.Rob source share