Message Queues

Message queues provide applications with a way to exchange information through messages. Applications can send messages to these queues and read the messages they contain. The following illustration shows a single message queue with one application sending messages to the queue and another application reading its messages.

However, this illustration does not indicate where messages are stored. A queue's messages are stored on the computer that was designated when the queue is created.

To an application, the most important classifications of these queues are whether they are public or private. Although both public and private queues have significant advantages, the choice to make a queue public or private depends on whether or not you want others to be able to locate the queue.

The advantage of public queues is that they are registered in the MQIS information store (MSMQ) so they can be located by any MSMQ application. Public queues are persistent and their registration information can be backed up on the MSMQ enterprise, making them good for long-term use.

Private queues are registered on the local computer and typically cannot be seen by other applications. To register a private queue, MSMQ stores a description of the queue, plus cached information about any local public queues, in the LQS (local queue storage) directory on the local computer (the default LQS directory is \program files\msmq\storage\lqs). Private queues do have the advantage of no MQIS overhead (faster to create, no latency, and no replication), and they can be created and deleted when the MQIS is not working.

Private queues can be exposed to other applications if the queue's location is sent to the other application. This is done by sending the private queue's format name to the other application. (For applications using API functions, see PROPID_M_RESP_QUEUE. For applications using ActiveX components, see ResponseQueueInfo).

Examples


© 1997 by Microsoft Corporation. All rights reserved.