Share via


4.1 Receive Example

The following sequence diagram illustrates a supporting server receiving a message from a queue on a remote queue manager on behalf of an MQMP application. It is closely related to the example in section 4.2 of [MS-MQMP] and represents an expansion of step 12 of that example. This example assumes that steps 1-11 of that example have been executed prior to the beginning of the following sequence diagram, and that steps 13 and 14 of that example will be executed after the end of the following sequence diagram.

Client receive

Figure 2: Client receive

In response to the MQMP application invoking the rpc_ACReceiveMessageEx method of [MS-MQMP], the supporting server invokes methods on the remote queue manager on the MQMP application's behalf:

  1. The supporting server calls RemoteQMStartReceive on the remote queue manager with a ulAction value of MQ_ACTION_RECEIVE (0x00000000) and a unique dwRequestID value chosen by the client.

  2. The remote queue manager associates a pending request with the passed dwRequestID, which will be used to correlate a subsequent call to RemoteQMEndReceive or RemoteQMCancelReceive with the same value for dwRequestID. In addition, the remote queue manager returns the message and MQ_OK (0x00000000) to indicate success.

  3. The supporting server indicates that the message was successfully received by calling RemoteQMEndReceive, specifying RR_ACK (0x00000002) for dwAck.

  4. The remote queue manager completes the corresponding pending request created by the call to RemoteQMStartReceive and, because RR_ACK is specified, removes the message from the queue. It also returns MQ_OK (0x00000000) to indicate success.