Updated on 2024-10-15 GMT+08:00

Clearing Messages in a RabbitMQ Queue

This section describes how to clear all the messages in a queue. Methods of deleting messages:

The two methods are supported in RabbitMQ 3.8.35. For RabbitMQ AMQP-0-9-1 instances, messages in a queue can only be cleared on the console.

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

Prerequisite

A queue has been created.

Clearing Messages in a Queue (Console)

  1. Log in to the console.
  2. In the upper left corner, click and select a region.

    Select the region where your RabbitMQ instance is.

  3. Click and choose Middleware > Distributed Message Service for RabbitMQ to open the console of DMS for RabbitMQ.
  4. Click an instance name to go to the instance details page.
  5. In the navigation pane, choose Virtual Hosts.
  6. Click a virtual host name.
  7. On the Queue tab page, click Clear Message in the row containing the desired queue. The Clear Message dialog box is displayed.
  8. Click OK.

Clearing Messages in a Queue (RabbitMQ Management UI)

  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