Reading Messages in a Queue

Reading messages in a queue can be done synchronously or asynchronously.

When reading messages synchronously, execution is blocked until a message is available or the message time-out timer expires.

When reading messages asynchronously, execution continues until an Arrived or ArrivedError event is fired. The Arrived and ArrivedError events are provided by the MSMQEvent object.

Cursors are never explicitly defined when reading messages in a queue. However, a single implicit cursor can be used to navigate through the queue. The methods used to navigate through the queue are all defined in terms of this implicit cursor.

For examples of reading messages, see:

For a description of how the messages in a queue are moved about when an application peeks at or retrieves a message, see Reading Messages.