RabbitMQ - purge a queue from all of its unacked messages

后端 未结 8 747
孤街浪徒
孤街浪徒 2020-12-29 03:03

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?

8条回答
  •  情深已故
    2020-12-29 03:38

    You have to make consumer ack them (or nack) and only after that they will be removed. Alternatively you can shutdown consumers and purge the queue completely.

    If you are looking for some way to purge all unacked messages - there are no such feature nor in AMQP protocol neither in RabbitMQ.

    It looks like your consumer is the cause of the problem, so you have to adjust it (rewrite) to release message immediately after it processed or failed.

提交回复
热议问题