Cloud Application Integration (On-Premises) : Integration Server Built-In Services : JMS Folder : pub.jms:waitForReply
pub.jms:waitForReply
WmPublic. Retrieves the reply message for an asynchronous request.
Input Parameters
correlationID
String Unique identifier used to associate the reply message with the initial request.
timeout
java.lang.Long Optional. Time to wait (in milliseconds) for the reply to arrive.
If timeout is greater than 0 (zero) and a reply is not available at the time the pub.jms:waitForReply service executes, the service continues to wait for the document until the time specified in the timeout parameter elapses. If the service does not receive a reply by the time the timeout interval elapses, the pub.jms:waitForReply service returns a null document.
If timeout is set to 0 (zero), the pub.jms:waitForReply service waits indefinitely for a response. Software AG does not recommend setting timeout to 0 (zero).
If timeout is not set, the pub.jms:waitForReply service does not wait for a reply. The pub.jms:waitForReply service always returns a null document. The service returns a null document even if the reply queue contains a response for the request.
Output Parameters
JMSReplyMessage
Document Conditional. Document containing the JMS message received as a reply.
If the pub.jms:waitForReply service does not receive a a reply before the specified timeout value elapses of the timeout value was not specified, the JMSReplyMessage is null.
Key
Description
header
Document Conditional. A Document containing the header fields for the reply message.
Key
Description
JMSCorrelationID
String Conditional. A unique identifier used to link the reply message with the initial request message.
JMSDeliveryMode
java.lang.Integer Conditional. Delivery mode used to send the message.
PERSISTENT indicates that the JMS provider provides once-and-only-once delivery for the message. The message will not be lost if a JMS provider failure occurs.
NON_PERSISTENT indicates that the JMS provider provides at-most-once delivery for the message. The message has no guarantee of being saved if a JMS provider failure occurs.
JMSDestination
Object Conditional. Destination (queue or topic) to which the message was sent.
JMSExpiration
java.lang.LongConditional. Time at which this message expires. If the message producer did not specify a time-to-live, the JMSExpiration value is zero, indicating the message does not expire.
JMSMessageID
String Conditional. Unique identifier assigned to this message by the JMS provider.
JMSPriority
java.lang.Integer Conditional. Defines the message priority. The JMS standard defines priority levels from 0 to 9, with 0 as the lowest priority and 9 as the highest.
JMSRedelivered
java.lang.Boolean Conditional. Flag indicating the JMS provider delivered this message to the JMS client previously.
True indicates the message may have been delivered in the past.
False indicates the JMS provider has not delivered this message previously.
JMSReplyTo
Object Conditional. Specifies the destination to which a response to this message should be sent.
JMSTimestamp
java.lang.Long Conditional. Time at which the message was given to the JMS provider.
JMSType
String Conditional. Message type identifier specified by the client when sending the message.
properties
Document Conditional. A document containing optional fields added to the message header. Integration Server may add the following properties to JMS messages it sends or receives.
Key
Description
JMSXDeliveryCount
java.lang.Integer Conditional. Specifies the number of times the JMS provider delivered the message to the requesting client. Most JMS providers set this value.
JMS_WMCluster Nodes
String Conditional. Name of the Broker or Brokers in the Broker cluster that received the JMS message.
The Broker Server acting as the JMS provider populates the JMS_WMClusterNodes parameter after it distributes the JMS message to the Broker or Brokers in the Broker cluster.
The JMS_WMClusterNodes value will be null when:
*The JMS provider is not the Broker Server.
*The JMS connection alias used to send the JMS message does not use a cluster connection factory to obtain the connection to the Broker Server.
*The cluster connection factory does not permit a policy to be overridden.
activation
String Conditional. A unique identifier assigned by the sending service. A JMS trigger uses the activation to determine whether a message is part of a join.
uuid
String Conditional. A universally unique identifier for the message assigned by the sender. Integration Server can use the uuid for exactly-once processing or for request/reply.
body
Document Conditional. A Document containing the JMS message body. Integration Server supports the following formats for the JMS message body:
Key
Description
string
String Conditional. Message body in the form of a String.
bytes
primitive type Conditional Message body in the form of a one-dimensional byte array.
object
Object. Conditional. Message body in the form of a Serializable Java object.
data
Document Optional. Message body in the form of a document (IData object).
Note:  
This message format can only be used when sending a JMS message from one Integration Server to another. When the JMS message is sent, the sending Integration Server encodes the IData into a byte array. When the receiving Integration Server receives the message, it decodes the byte array into IData.
message
Object Optional. Message body in the form of an actual javax.jms.Message.
Usage Notes
Integration Server uses the value of the uuid or JMSMessageID fields in the requesting JMS message to correlate the response to the request. If you specify the uuid when sending the request, the replying Integration Server will use the uuid as the JMSCorrelationID of the reply message (JMSReplyMessage). If you do not specify a uuid, the replying Integration Server uses the JMSMessageID set by the JMS provider as the JMSCorrelationID of the reply message (JMSReplyMessage).
If you set the uuid in the JMS message request, you can link the value of the uuid field from the JMSMessage produced by the pub.jms:sendAndWait service to the correlationID input field of the pub.jms:waitForReply service. If you did not specify a uuid, you can link the JMSMessageID field from the JMSMessage produced by the pub.jms:sendAndWait to the correlationID input field.
The timeout value of the sending service specifies how long Integration Server will keep the request open while waiting for a reply. If a reply is not available at the time Integration Server executes the pub.jms:waitForReply service, Integration Server continues to wait for the document until the time specified in the timeout parameter elapses. If the service does not receive a reply by the time the timeout interval elapses, the service returns a null document.
The pub.jms:waitForReply service cannot be used to retrieve response to requests that were routed through the client side queue. To retrieve the response, create a JMS trigger that subscribes to the reply queue.
If the pub.jms:sendAndWait service executes and the message is sent directly to the JMS provider (i.e., it is not sent to the client side queue), the JMSMessage\header\JMSMessageID contains a unique identifier assigned by the JMS provider. If the JMSMessageID field is null after the service executes, the JMS provider was not available at the time the service executed. Integration Server wrote the message to the client side queue.
See Also
pub.jms:sendAndWait
Copyright © 2015- 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback