Skip to content

Instantly share code, notes, and snippets.

@flopezluis
Created March 23, 2012 15:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flopezluis/2172067 to your computer and use it in GitHub Desktop.
Save flopezluis/2172067 to your computer and use it in GitHub Desktop.
Bookmark to purge all the queues in a vhost. RabbitMQ
//add this to your bookmarks. The default vhost in RabbitMq is "/",
// so you should have as virtualhost %2F, but due to chrome escape it, i used %252f
//i assume you're in the management site (http://www.rabbitmq.com/management.html)
javascript:
vhost="%252f";
var purge = function(name) {
$.ajax({
url:'api/queues/' + vhost + "/" + name + '/contents/',
type: 'DELETE',
success:function(data) {
console.log(name + " purged");
}
});
};
$.ajax({
url: '/api/queues/' + vhost,
success: function(data) {
for (queue in data) {
queue_name = data[queue].name;
purge(queue_name);
}
}
});
@boly38
Copy link

boly38 commented Nov 19, 2018

Thanks flopezluis for this sample that help me to produce the following bash script https://gist.github.com/boly38/8dd3f9efae25136d8ae0c5974531fd9b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment