Partager via


Cursor Behavior when Waiting for New Messages

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

When waiting for a message at the end of the queue, the cursor will automatically point to a new message when one arrives. When the new message and the messages already in the queue all have the same priority levelP, the new message is placed at the end of the queue where the cursor is waiting. In this case, the cursor is already pointing at the location of the new message and the receiving application can process the message and return the cursor to the end of the queue.

However, when messages with different priority levels arrive at the queue, they are placed in the queue according to their priority. In this case, Message Queuing moves the cursor to the location of the new message where the receiving application can process the message, but the receiving application will have to decide how it wants to proceed. Because the cursor may be at some location within the queue, the message at the next location may be a message that the application has already processed.

When waiting for messages, when the cursor is pointing at the end of the queue, the cursor is always moved to the location of the newest message that arrives at the queue.

More Information

For information on See
How a cursor is moved to the first message when the cursor is created. Cursor Behavior when Creating a Cursor
How the cursor is moved when peeking at messages Cursor Behavior when Peeking at Messages
How the cursor is moved when retrieving messages Cursor Behavior when Retrieving Messages
How the cursor is moved when reaching the end of the queue Cursor Behavior when Reaching the End of the Queue
How multiple cursors interact Cursor Behavior when Using Multiple Cursors
How the cursor behaves when trying to read a message that was removed by someone else. Cursor Behavior When Messages are Not Available
How the behaves when errors occur. Cursor Behavior Due to Errors
How the cursor behaves when trying to read messages from a deleted queue Cursor Behavior and Deleted Queues
How the cursor moves when the queue contains messages with different message priority levels. Cursor Behavior and Message Priority
Summary of COM methods that use cursors for synchronous and asynchronous operations Cursors and COM Components
Example code that navigates a queue based on cursors. Navigating Queue Examples