Updated on 2025-07-31 GMT+08:00

Clearing Messages in a RabbitMQ Queue

This section describes how to clear all the messages in a queue.

Notes and Constraints

  • All the messages in the queue will be deleted permanently and cannot be restored. Exercise caution.
  • The two methods are supported for RabbitMQ 3.x.x. For RabbitMQ AMQP-0-9-1 instances, messages in a queue can only be cleared on the console.

Prerequisite

A queue has been created.

  1. Log in to the RabbitMQ console.
  2. Click in the upper left corner to select the region where your instance is located.
  3. Click an instance name to go to the instance details page.
  4. In the navigation pane, choose Instance > Virtual Hosts.
  5. Click a virtual host name.
  6. On the Queue tab page, click Clear Message in the row containing the desired queue. The Clear Message dialog box is displayed.

    All the messages in the queue will be deleted permanently and cannot be restored. Exercise caution.

  7. Click OK.
  1. Log in to the RabbitMQ management UI.
  2. On the Queues tab page, click the name of a queue.

    Figure 1 Queues

  3. Click Purge Messages to remove messages from the queue.

    Figure 2 Clearing messages in a queue

    All the messages in the queue will be deleted permanently and cannot be restored. Exercise caution.

Related Document

To clear messages in a queue by calling an API, see Clearing Messages in a Queue.