最简单方便的删除RabbitMq所有的queue

Another option for deleting all queues (since 3.2.0) is to define a policy which gives every queue a very short expiry.

$ rabbitmqctl set_policy deleter ".*" '{"expires":1}' --apply-to queues

Then - assuming your queues are unused, which I assume is why you're deleting them - this will expire them near-immediately. Remember to delete the policy again afterwards, or you'll struggle to declare anything...

This line creates a policy named deleter which applies to all names (.*) and will be applied to queues.

$ rabbitmqctl clear_policy deleter 


最方便的方法,没有之一;
总结为两部:
rabbitmqctl set_policy deleter ".*" '{"expires":1}' --apply-to queues
rabbitmqctl clear_policy deleter 

搞定!
 
posted @ 2021-06-09 14:45  小哥的吃喝玩乐  阅读(370)  评论(0编辑  收藏  举报