Using MSMQ as an RPC Transport

The RPC subsystem supports using MSMQ as a transport in synchronous and asynchronous modes.

Synchronous mode uses conventional remote procedure calls. These calls use well-known endpoints and the message queue transport, ncadg_mq, as the transport protocol. In synchronous mode, your remote procedures can have [ in] and [ out] parameters and can use the standard RPC security services. The RPC subsystem creates a reply queue for remote calls containing [out] parameters. The synchronous mode is useful for applications where the client needs to receive data from the server. The main limitation of this mode is that, as with conventional remote procedure calls, both the client and server must be running and remain running for the duration of the call.

Asynchronous mode lets client applications make calls to the server and return immediately, regardless of the state of the server application or the server computer. It also makes a subset of MSMQ features available for managing message queues and information flow. The RpcBindingSetOption function lets you control quality of service, call priority, journaling, security, and the lifetime of the server process queue. The RpcServerUseProtseqEpEx function lets you specify attributes of the server process queue, such as queue persistence, authentication, and encryption.

You implement asynchronous MSMQ as you would synchronous MSMQ. You must use well-known endpoints, and define the transport protocol to be ncadg_mq. In your IDL file, apply the message attribute to the functions that use asynchronous message queuing. Note that message functions can have [in] parameters only.

 

 

Show: