IBM Support

Synchronous JMS Components - Request/Reply

Troubleshooting


Problem

Synchronous JMS Components - Request/Reply

Symptom

Users have been unable to make Synch MQ JMS Component work. The Response is not being picked up, and the whole thing just times out.

The setup is :
1. MyTestService : Single Synch MQ Component, with Request/Response Queues set. The selector on the response is : APINAME=SomeAPI
2. Invoke this Service, via API Tester with a XML Message
3. This successfully puts a message in the Request Queue.
4. To simulate a response put a message with correct header (APINAME=SomeAPI), in the response Queue manually.
5. MyTestService fails to pickup the message from Response Queue and proceed. It just times out.


Another Question:
Assuming this Request/Reply mechanism works, how does yantra synch component know, which Response is for which Request (Does it internally use some id to track this) ?
( SELECTOR alone does not help, it would select all responses if it worked )

Resolving The Problem

In addition to the selector, we also expect a header called MESSAGEID to be present. The receiver will only pick up a message with the same MESSAGEID as the message it put in [this is auto-generated per message to be unique].

So the other end must read this header and be sure to set it on the response.

The other system also needs to set the CorrelationID on the message it sends back.

For example:
code:


String msgid = req.getStringProperty("MESSAGEID");

resp.setStringProperty("MESSAGEID", msgid);
resp.setJMSCorrelationID(msgid);
JMSCorrelationID is immaterial. Reply msg can have a different correlation id.
- MESSAGEID, and SELECTOR (header) should be same on request and reply - for request/reply scenario to work.

Therefore, the replying app, must ensure that it copies the same MESSAGEID, and agreed upon SELECTOR header back on to the reply msg.

The MESSAGEID header is definitely required; we internally use it as part of the message selector to ensure that the thread gets back only the message it is looking for.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Document Information

Modified date:
22 June 2025

UID

swg21520676