Partager via


Reading Messages from a Queue Journal (COM) (Windows Embedded CE 6.0)

1/6/2010

To read messages from a queue journal you must first obtain the format name of the destination queue it is associated with.

The format name of the destination queue is combined with the "JOURNAL" keyword to create the format name of the queue journal.

Here is the syntax of a queue journal for both a public and private destination queue.

PUBLIC=QueueGUID;JOURNAL 
(where PUBLIC=QueueGUID is the format name of a public destination queue.)
PRIVATE=MachineGUID\QueueNumber;JOURNAL 
(where PRIVATE=MachineGUID\QueueNumber is the format name of a private destination queue.)

To retrieve a message from a queue journal

  1. Declare the variables needed to retrieve the message.

  2. Obtain the MSMQQueueInfo and call MSMQQueueInfo.Refresh to update the local properties of the MSMQQueueInfo object.

  3. Construct the format name for the queue journal.

  4. Call MSMQQueueInfo.Open to open the queue journal with receive access.

  5. Call MSMQQueue.Receive to retrieve the first message in the queue journal.

  6. Call MSMQQueue.Close to close the queue.

See Also

Concepts

Requesting Journaling (COM)
MSMQ COM Support
Using the COM Components
MSMQ Security

Other Resources

Message Queuing