Integration Server 10.5 | JMS Client Development Guide | Sending and Receiving JMS Messages | Sending a JMS Message and Waiting for a Reply | How to Send a JMS Message and Specify a Reply Destination without Waiting for a Reply
 
How to Send a JMS Message and Specify a Reply Destination without Waiting for a Reply
Integration Server provides the ability to send a message, specify a destination for replies, but not wait for or retrieve any reply messages. The act of waiting comes with extra overhead for Integration Server that is unnecessary if you do not want the sending service to wait for a reply.
The pub.jms:send service includes an input parameter for setting the JMSReplyTo header, specifically the JMSMessage/header/replyTo field. When executing the pub.jms:send service with a valid value for the JMSMessage/header/replyTo parameter, Integration Server creates the javax.jms.Destination and maps it to the JMSReplyTo field within the message header. Integration Server sends the message and returns immediately. The service does not wait for a response message. If JMSMessage/header/replyTo parameter is empty, then Integration Server does not set the JMSReplyTo header for the JMS message. If JMSMessage/header/replyTo is invalid, then Integration Server throws a ServiceException.
The following procedure describes the general steps you take to build a service that sends a request message, specifies a reply destination, but does not wait for a reply:
1. Follow the steps for sending a JMS message as described in How to Send a JMS Message.
2. When setting the values for the header fields in the JMS message, specify one of the following for the replyTo field.
*If the JMS connection alias used by the pub.jms:send service connects to the JMS provider using JNDI, set replyTo to be the lookup name of the destination lookup object name.
*If the JMS connection alias used by the pub.jms:send service connects to the JMS provider using a native Broker connection, set JMSMessage/header/replyTo to the Broker queue name. That is, if the JMS connection alias specifies the webMethods Broker as the JMS provider and uses the native webMethods API to connect directly to the Broker, specify the name of the queue on the Broker that should receive replies to the message.
Note:
When using the native webMethods API to connect to the Broker, the JMSMessage/header/replyTo destination must be a queue. Topics are not supported.