Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
JQuery code to Purge Specific Queues on RabbitMQ
var purgeQueue = function (name, callback) {
$.ajax({
url: 'api/queues/<vhost>/' + name + '/contents/',
type: 'DELETE',
success: callback
});
};
$.ajax({
url: '/api/queues/',
success: function (data) {
for (queue in data) {
queueName = data[queue].name;
if (queueName.startsWith("<Name of queue to Purge>")){
purgeQueue(queueName)
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment