The RPC subsystem supports using MSMQ as a transport in two modes—synchronous and asynchronous.
Synchronous mode is conventional RPC, implemented with well-known endpoints, and using 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 machine. It also makes available a subset of MSMQ features for managing message queues and information flow. The RPC function RpcBindingSetOption lets you control quality of delivery, 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 in much the same way as you would synchronous MSMQ. You must use well-known endpoints, and define the transport protocol to be ncadg_mq. In addition, in your IDL file, apply the message attribute to the functions that you want to take advantage of asynchronous message queuing. Note that message functions can have in parameters only.