简体   繁体   中英

rabbitmq (AMQP): delete all messages from a queue

There are some questions like mine on SO, but purge method is not suitable for me. From AMQP docs:

Purge a queue. This method removes all messages from a queue which are not awaiting acknowledgment .

What if I want to delete really all messages even if they are waiting acks? Is there any solution?

Thanks in advance!

AFAIK, you can't delete unacked messages. What you can do is get them back in ready state with basic.recover() or by killing the connection responsible for the unacked messages. After that you can purge the queue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM