> tibemsMsgRequestor
> Type
> Purpose
> Encapsulate request-reply semantics.
> Remarks
> We recommend that programs follow these steps:

> 1. | Create a tibemsSession, and use it to create either a tibemsQueue or tibemsTopic (respectively) for requests and replies.

> 2. | Supply that session and destination to tibemsMsgRequestor_Create to create a tibemsMsgRequestor.

> 3. | Call tibemsMsgRequestor_Request to send a request and receive a reply. You may repeat this step for several request and reply pairs.

> 4. | Close the requestor object. tibemsMsgRequestor_Close also closes the requestor’s session as a side effect.

> Function | Description | Page
> tibemsMsgRequestor_Close | Close a message requestor. | 197
> tibemsMsgRequestor_Create | Create a message requestor. | 198
> tibemsMsgRequestor_Request | Send a request message; wait for a reply. | 200

> See Also
> tibemsSession
> tibemsQueue on page 150
> tibemsTopic on page 156
> tibemsMsgRequestor_Close
> Function
> Purpose
> Close a message requestor.
> C Declaration
> tibems_status tibemsMsgRequestor_Close(
> tibemsMsgRequestor msgRequestor );
> COBOL Call
> CALL "tibemsMsgRequestor_Close"
> USING BY VALUE msgRequestor,
> RETURNING tibems-status
> END-CALL.

> | msgRequestor has usage pointer.

> Parameters

> Parameter | Description
> msgRequestor | Close this requestor.

> Remarks
> This call also closes the requestor’s session as a side effect.
> tibemsMsgRequestor_Create
> Function
> Purpose
> Create a message requestor.
> C Declaration
> tibems_status tibemsMsgRequestor_Create(
> tibemsSession session,
> tibemsMsgRequestor* msgRequestor,
> tibemsDestination destination);
> COBOL Call
> CALL "tibemsMsgRequestor_Create"
> USING BY VALUE session,
> BY REFERENCE msgRequestor,
> BY VALUE destination,
> RETURNING tibems-status
> END-CALL.

> | session, msgRequestor and destination have usage pointer.

> Parameters

> Parameter | Description
> session | The requestor operates within this session. This session must not use transaction semantics. Its delivery mode must be either TIBEMS_AUTO_ACKNOWLEDGE or TIBEMS_DUPS_OK_ACKNOWLEDGE.
> msgRequestor | The function stores the new requestor in this location.
> destination | The requestor sends request messages to this destination, and waits for replies on an internally created temporary destination. If the destination that request messages are sent to is a queue, then an internal temporary queue is created and used. If the destination that request messages are sent to is a topic, then an internal temporary topic is created and used. You must create this destination using the session you supply as the first argument.

> Remarks
> We recommend that programs follow these steps:

> 1. | Create a tibemsSession, and use it to create a tibemsQueue or tibemsTopic for requests and replies.

> 2. | Create a tibemsMsgRequestor, using the session and destination as arguments.

> 3. | Send a request and receive a reply with tibemsMsgRequestor_Request. You may repeat this step for several request and reply pairs.

> 4. | Close the requestor object. tibemsMsgRequestor_Close also closes the requestor’s session as a side effect.

> See Also
> tibemsDestination on page 144
> tibemsMsgRequestor_Close on page 197
> tibemsMsgRequestor_Request on page 200
> tibemsSession on page 286
> tibemsMsgRequestor_Request
> Function
> Purpose
> Send a request message; wait for a reply.
> C Declaration
> tibems_status tibemsMsgRequestor_Request(
> tibemsMsgRequestor msgRequestor,
> tibemsMsg message,
> tibemsMsg* reply );
> COBOL Call
> CALL "tibemsMsgRequestor_Request"
> USING BY VALUE msgRequestor,
> BY VALUE message,
> BY REFERENCE reply,
> RETURNING tibems-status
> END-CALL.

> | msgRequestor, message and reply have usage pointer.

> Parameters

> Parameter | Description
> msgRequestor | Send and receive through this requestor.
> message | Send this request message.
> reply | When a reply message arrives, the function stores it in this location.

> Remarks
> This call blocks indefinitely, until a reply arrives.
> The requestor receives only the first reply. It discards other replies that arrive subsequently.

Copyright © TIBCO Software Inc. All Rights Reserved.