Integration Server 10.15 | JMS Client Development Guide | Sending and Receiving JMS Messages | Replying to a JMS Message
 
Replying to a JMS Message
 
How to Send a Reply Message
You can create a service that sends a reply message in response to a received request message. The reply message might be a simple acknowledgement or might contain information requested by the sender.
When you send a reply message, Integration Server uses information in the request message to determine the reply destination. The JMSReplyTo field in the request message is set by the sending client and indicates the destination to which the reply will be sent. The replying Integration Server automatically sets this value when it executes the pub.jms:reply service.
When replying to a message, Integration Server also automatically sets the JMSCorrelationID in the reply message. Integration Server, and many JMS clients, use the JMSCorrelationID to correlate the reply message with the request message. Integration Server uses the value of the wm_tag, uuid or JMSMessageID fields in the requesting JMS message to correlate the request and the response.Integration Server determines which field to use as the JMSCorrelationID using the following order.
*If the request message contains a wm_tagvalue in the JMSMessage/properties, Integration Server uses the wm_tag value as the JMSCorrelationID of the reply message. The wm_tag field is used to correlate the reply with a dedicated listener created for a particular JMS connection alias.
*If the sender of the request message specified the uuid, the replying Integration Server uses the uuid as the JMSCorrelationID of the reply message.
*If the sender of the request message did not specify a uuid, the replying Integration Server uses the JMSMessageID from the request message as the JMSCorrelationID of the reply message.
The pub.jms:reply service sends the reply message using the same connection that was used to retrieve the message.