KB Article #177995

[JMS] Correlate response when JMSCorrelationID is set to the JMSMessageID of the request

Problem

-- When receiving a response to a JMS message, consumer of the message can use any attribute of the message as a value for the JMSCorrelationID of the response.


-- How to correlate response with the message when consumer use the JMSMessageID of the request for JMSCorrelationID.

Resolution

- In the Send To JMS filter, after sending the request, JMS Message parameters are available in jms.outbound.message attribute.


- JMSMessageID header value is available in jms.outbound.message.JMSMessageID.


- So, it's possible to correlate request and response by setting the following selector in the response tab of the Send To JMS filter:

JMSCorrelationID='${jms.outbound.message.JMSMessageID}'