Deleting Messages

Delete individual messages, many messages, or purge all messages from a queue or channel. When you purge a queue, any existing channels are also purged.

The DeleteMessage and DeleteMessages requests require the receipt of the message retrieved from a GetMessages request.

  • You can use the Console to delete individual messages from a queue or entirely purge a queue.

    Delete Selected Messages from a Queue

    1. 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.
    2. On the details page for the queue, select Messages.
    3. Select Poll for messages.
    4. Select Continue.
    5. In the Messages section, select the messages to delete.
    6. Select Delete selected messages.
    7. Confirm when prompted.

    Purge a Queue

    1. 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.
    2. On the details page for the queue, select Messages.
    3. Select More actions and then select Purge queue or Purge DLQ.
    4. Confirm the action and then select Purge.

    Purge a Channel

    1. 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.
    2. On the details page for the queue, select Channels.
    3. From the Actions menu for the queue, select Purge Channel.
    4. Confirm the action and select Purge.
  • Use the oci queue messages delete-message command to delete a single message from the queue.

    oci queue messages delete-message --message-receipt <message_receipt> --queue-id <queue_OCID>

    Use the oci queue messages delete-messages command to delete messages from the queue.

    oci queue messages delete-messages --entries file://entries.json --queue-id <queue_OCID>

    Use the oci queue queue-admin queue purge command to delete all messages in a queue or channel.

    oci queue queue-admin queue purge --purge-type <purge_type> --queue-id <queue_OCID> --channel-id <channel_id>

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Use the DeleteMessage or DeleteMessages operation to delete messages from a queue.

    Use PurgeQueue to delete all messages in a queue or channel.

    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.