3.2.4.1 Opening a Queue

To open a queue, the following inputs are expected:

  • RemoteServer: the name or network address that identifies the machine where the queue resides.

  • QueueHandle: A value returned in the phQueue parameter by the remote server when the qmcomm:R_QMOpenRemoteQueue method is called ([MS-MQMP] section 3.1.4.2) by the MQMP application.

  • QueueDescriptor: A value returned in the dwpQueue parameter by the remote server when the qmcomm:R_QMOpenRemoteQueue method is called ([MS-MQMP] section 3.1.4.2) by the MQMP application.

  • OpenContext: A value returned in the pdwContext parameter by the remote server when the qmcomm:R_QMOpenRemoteQueue method is called ([MS-MQMP] section 3.1.4.2) by the MQMP application.

The supporting server MUST perform the following actions to process this event:

  • Construct an RPC binding handle to the qm2qm interface on the remote server identified by RemoteServer, as specified in [C706] section 2.3.

  • Call the RemoteQMGetQMQMServerPort method using the RPC handle from the previous step. This method returns the RPC endpoint port on which subsequent method calls to this interface are to be invoked.

  • Construct a new RPC binding handle to the remote server using the RPC endpoint port determined in the previous step and close the initial RPC binding handle to the remote server. Any subsequent calls to the remote server require the new RPC binding handle to be successfully created. The new handle is closed when the queue is closed as specified in section 3.2.4.9.

  • Call the RemoteQMOpenQueue method and specify the following parameter values:

    • The RPC binding handle constructed in previous steps.

    • pLicGuid set to the QueueManager.Identifier of the queue manager.

    • If QueueManager.RoutingServer is True or QueueManager.DirectoryServer is True, set dwMQS to 0x00000001; otherwise set dwMQS to 0x00000000.

    • hQueue set to QueueHandle.

    • pQueue set to QueueDescriptor.

    • dwContext set to OpenContext.

  • The time-out for the RemoteQMOpenQueue method SHOULD be five minutes, and if the RPC call does not complete within this time, the call is canceled with the cancel time-out of zero minutes. For details on canceling an RPC call, refer to [C706] section 6.1.8.

  • Create a new RemoteOpenQueueEntry using the following:

    • OpenQueueDescriptorHandle = QueueHandle

    • RRSessionHandle = the returned phContext

  • Add the RemoteOpenQueueEntry to rRemoteOpenQueueEntryCollection.