Message Management
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.
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:
https://cell-1.queue.messaging.<region>.oci.oraclecloud.com
To find a queue's messages endpoint:
- Open the navigation menu and click Developer Services. Under Application Integration, click Queues.
- On the left side of the screen, click Queues.
A list of existing queues is displayed.
- Click the name of a queue to display its Details page.
- The Queue information section contains the Messages endpoint.
You can find the messages endpoint using the API with a GetQueue
request.
Required IAM Policy
See Queue Policies and Policy Examples for details on required permissions for queue management.