Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
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.
Copy Code | |
---|---|
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.) |
-
Declare the variables needed to retrieve the message.
-
Obtain the MSMQQueueInfoand call MSMQQueueInfo.Refreshto update the local properties of the MSMQQueueInfoobject.
-
Construct the format name for the queue journal.
-
Call MSMQQueueInfo.Opento open the queue journal with receive access.
-
Call MSMQQueue.Receiveto retrieve the first message in the queue journal.
-
Call MSMQQueue.Closeto close the queue.