1.3.3 Queue Operations
The protocol provides mechanisms for the following operations against an open queue.
A message can be consumed from an open queue through a destructive read operation referred to as Receive. This operation atomically reads the message and removes it from the queue. Since this operation removes a message from a queue, losing a network connection during this operation could result in permanent loss of the message.
To guard against this situation, the protocol provides a mechanism for the client to either positively or negatively acknowledge receipt of the message. On receipt of positive acknowledgment from the client, the server can remove the message from the queue. While the server is awaiting acknowledgment from the client, access to the message by other clients is prevented.
A message can be read from an open queue through a nondestructive read operation referred to as Peek. This operation reads the message but does not remove it from the queue.
All the messages can be removed from a queue through a Purge mechanism. The messages removed through this mechanism are not returned to the client.
A client can inform the server that it has no need of a message via a CancelReceive operation. The server can use this indication to inform the sender that the client did not consume the message. How a server implements this notification functionality is not addressed in this specification.
When a client does a destructive read, the message is not deleted from the queue until the client acknowledges receipt of the message via an EndReceive operation.