Integration Server 10.7 | Built-In Services Reference Guide | Publish Folder | Summary of Elements in this Folder | pub.publish:waitForReply
 
pub.publish:waitForReply
WmPublic. Retrieves the reply for an asynchronous request. If a reply is not available, Integration Server continues to wait for the document until the time specified in the waitTime parameter of the pub.publish:deliverAndWait service or pub.publish:publishAndWait service elapses.
Input Parameters
tag
String A unique identifier for the publish request for which you are retrieving a reply. Integration Server uses the tag value to match the request document with its corresponding reply document.
Output Parameters
receivedDocument
Document Document (IData object) received as the reply to the request. If the request expires (that is, the waitTime elapses) before Integration Server receives the reply document, the receivedDocument field contains a null document.
Important:Integration Server treats all reply documents as volatile documents. If Integration Server shuts down before processing the reply document, the reply document is lost.
Usage Notes
The waitTime value of the publishing service specifies how long Integration Server will keep the request open while waiting for a reply. When building an asynchronous request/reply service, keep the following information about the waitTime in mind:
*The waiting interval for the reply document starts when Integration Server executes the request service ( pub.publish:deliverAndWait or pub.publish:publishAndWait). The execution of the pub.publish:waitForReply service does not affect the waitTime interval.
*If the waitTime interval elapses before the pub.publish:waitForReply service executes, the service immediately returns a null document which indicates that the wait time has expired.
*If Integration Server has not received the reply when the pub.publish:waitForReply service executes, the service waits the remainder of the waitTime interval. If Integration Server does not receive a reply by the time the waitTime interval elapses, the request completes. The service returns a null document which indicates that the wait time has expired.
*If the reply document arrives after the waitTime interval elapses, Integration Server rejects the document because the request is closed.
A single publish and wait request might receive many response documents. The Integration Server that made the publish and wait request uses only the first reply document it receives. Integration Server discards all other replies. First is arbitrarily defined. There is no guarantee provided for the order in which the messaging provider processes incoming replies. If you need a reply document from a specific recipient, use the pub.publish:deliverAndWait service instead.
For more information about building an asynchronous request/reply service, see the Publish-Subscribe Developer’s Guide.
See Also
pub.publish:deliverAndWait
pub.publish:publishAndWait