I want to delete all the messages from the rabbit mq queue before i start pushing data in it. How can this be achieved ? I am using https://www.npmjs.com/package/amqplib
there's a purgeQueue
method: http://www.squaremobius.net/amqp.node/channel_api.html#channel_purgeQueue
channel.purgeQueue("some.queue");
purge_queue can be used to remove all undelivered messages from the queue named.
purgeQueue(queue, [function(err, ok) {...}])
Remove all undelivered messages from the queue named.messageCount, containing the number of messages purged from the queue is returned.
You can also do this using command-line:
sudo rabbitmqctl purge_queue queue_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With