How to delete rabbitmq queues in batch using CLI
Use rabbitmqctl
# delete all queues
rabbitmqctl list_queues | awk '{ print $1 }' | xargs -L1 rabbitmqctl delete_queue
# only delete filterd queues
rabbitmqctl list_queues | grep -i keyword | awk '{ print $1 }' | xargs -L1 rabbitmqctl delete_queue
Use rabbitmqadmin
# delete all queues
rabbitmqadmin list queues name -f tsv | xargs -I qn rabbitmqadmin delete queue name=qn
# only delete filterd queues
rabbitmqadmin list queues name -f tsv | grep -i keyword | xargs -I qn rabbitmqadmin delete queue name=qn