Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ - purge a queue from all of its unacked messages

Tags:

rabbitmq

I have thousands of unacked messages in my dev environment which I can't restart.
Is there a way to remove (purge) all messages even if they are unacknowledged?

like image 237
Bick Avatar asked Aug 04 '14 08:08

Bick


People also ask

How do I purge RabbitMQ queues?

Log in to the Management Web UI. For details, see Connecting to the Management Address of a RabbitMQ Instance. On the Queues tab page, click the name of a queue. Click Purge Messages to remove messages from the queue.

What happens to Unacked messages in RabbitMQ?

RabbitMQ Unacked Messages are the messages that are not Acknowledged. If a consumer fails to acknowledge messages, the RabbitMQ will keep sending new messages until the prefetch value set for the associated channel is equal to the number of RabbitMQ Unacked Messages count.

How do you clean RabbitMQ?

A queue can be purged from the RabbitMQ Management Interface. Click the Queue tab and go to the bottom of the page. You will find a dropdown "Delete / Purge" there. Press Purge to the right to empty the queue.


1 Answers

Close the channel that the unacked messages reside on, which will nack them back into the queue, then call purge.

like image 172
Acorn Avatar answered Sep 21 '22 13:09

Acorn