Requestors

An application uses a requestor to send a request message and then to wait for and to receive the reply.

Many messaging applications are based on algorithms that send a request message and then wait for a reply. XMS provides a class called Requestor to help with the development of this style of application.

To create a requestor, an application calls the Create Requestor constructor of the Requestor class, specifying as parameters a Session object and a Destination object that identifies where request messages are to be sent. The session must not be transacted nor have an acknowledgement mode of XMSC_CLIENT_ACKNOWLEDGE. The constructor automatically creates a temporary queue or topic where reply messages are to be sent.

After creating a requestor, the application can call the Request method of the Requestor object to send a request message and then wait for, and receive, a reply from the application that receives the request message. The call waits until the reply is received or until the session ends, whichever occurs first. Only one reply is required by the requestor for each request message.

When the application closes the requestor, the temporary queue or topic is deleted. The associated session, however, does not close.