Hopefully it might help someone.
I tried the above pieces of code but I did not do any streaming.
sudo rabbitmqctl list_queues | awk '{print $1}' > queues.txt; for line in $(cat queues.txt); do sudo rabbitmqctl delete_queue "$line"; done
.
I generate a file that contains all the queue names and loops through it line by line to the delete them. For the loops, while read ...
did not do it for me. It was always stopping at the first queue name.
Also, if you want to delete a single queue, the above solutions will help(python, Java ...) and also do sudo rabbitmqctl delete_queue queue_name
. I am using rabbitmqctl
instead of rabbitmqadmin
.