Software AG Products 10.5 | Administering Integration Server | Configuring Integration Server for JMS Messaging | Working with JMS Connection Aliases | Creating a JMS Connection Alias | Creating a Dedicated Listener for Receiving Replies
 
Creating a Dedicated Listener for Receiving Replies
Integration Server includes the ability to create a dedicated consumer for receiving replies to a published request. You configure this functionality per JMS messaging connection alias.
When the pub.jms:sendAndWait service executes a synchronous request-reply, Integration Server sends the request message to the JMS provider and waits for a reply. By default Integration Server creates a new JMS MessageConsumer for each reply message. In many situations, creating one MessageConsumer per response does not impact performance. However, in some situations, such as when many threads invoke pub.jms:sendAndWait concurrently, creating a MessageConsumer for every expected response can impact performance.
To address this, Integration Server includes an option named Enable Request-Reply Listener for Temporary Queue that, when selected, creates a single dedicated MessageConsumer for receiving synchronous replies sent by the JMS connection alias. If Integration Server uses a single consumer to retrieve all synchronous replies for requests sent by a particular JMS connection alias, when executing pub.jms:sendAndWait service, Integration Server assigns a unique value to the new wm_tag field used as a property in the JMS message, specificallyJMSMessage/properties/wm_tag. When using pub.jms:reply to reply to a JMS message request for which wm_tag is populated, the replying Integration Server maps the value of wm_tag to JMSMessage/header/JMSCorrelationID field in the reply message.
To use a dedicated consumer to retrieve replies to all requests sent using a particular JMS connection alias, the following must be true:
*The JMS connection alias used to send the request must have the following configured:
*The Create Temporary Queue check box must be selected.
*The Enable Request-Reply Listener for Temporary Queue check box must be selected. This is a new option for a JMS connection alias.
*The pub.jms:sendAndWait invocation:
*Must be synchronous (the async input parameter must be set to false).
*Must not specify a value for the destinationNameReplyTo input parameter.