Read about how to publish, consume, and manage messages in a queue.
Example Queue Flow
The following diagram provides an example where producer sends a message to a queue and two consumers attempt to process it.
A producer sends a message to the queue with default message retention time.
The producer receives confirmation that the Queue service received and stored the message.
Consumer A tries to receive the message.
Consumer A receives the message, which it's supposed to process within Visibility Timeout A.
Consumer B tries to receive a message.
Consumer B receives nothing, because the only available message was already consumed by Consumer A.
Consumer A fails to process message within Visibility Timeout A, so it updates the message to extend the visibility timeout.
Consumer B tries to receive a message again.
Consumer B receives nothing, because the only available message was consumed and extended by Consumer A.
The extended visibility timeout elapses.
Consumer B tries to receive a message a third time.
Consumer B receives the message, which it's supposed to process within Visibility Timeout B.
Consumer A tries to receive the message, but receives nothing, because Consumer B consumed the message.
Consumer A can no longer extend the message's visibility timeout or delete the message.
Consumer B processes the message successfully and tries to delete the message from the queue.
Consumer B receives confirmation that the message was permanently deleted, so it can't be delivered to any other consumer.
Note
Every time a message is delivered to a consumer, the message's Delivery Count field is incremented. When a message's delivery count reaches the configured maximum, it's sent to a dead letter queue.
Messages Endpoint 🔗
To produce to a queue or consume from a queue, you need to know the messages endpoint used by that queue. A queue's messages endpoint looks something such as this: