Consuming Messages from a Queue
Consume messages from a queue.
Consuming messages requires permissions to the queue and access to its Messages endpoint. For more information, see Consuming Messages.
If the queue has channels, a consumption request without a channel ID returns messages from either the queue or one of its channels.
Polling increases the delivery count value for the message. Depending on the dead letter queue settings, polling can remove the message from a queue or channel and send it to a dead letter queue or channel.
You can't use the Console to consume messages, but you can use it to poll for messages. Polling messages serves as a peek at the queue. Messages polled by the Console are unavailable to other consumers until the visibility timeout passes.
- On the Queues list page, select the queue that you want to work with. If you need help finding the list page or the queue, see Listing Queues.
- On the details page for the queue, select Messages.
- (Optional) Select Manage polling settings. Provide the following information and then click Save changes:
- Polling timeout (seconds): The length of time to wait for messages to consume.
- Number of messages in a request: The maximum number of messages to consume when polling.
- Select Poll for messages.
- Select Continue.
If messages are available for consumption, they display in the Messages table. Messages are randomly polled from the queue or one of its channels. Messages from a channel are displayed with their Channel ID.
Use the
oci queue messages get-messages
command and required parameters to consume messages from a queue:oci queue messages get-messages --queue-id <queue_OCID>
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Use the GetMessages operation to consume messages. A
GetMessages
request contains an optionallimit
, an optionalvisibilityInSeconds
, and an optionaltimeoutInSeconds
parameter.For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.