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 = (name, callback) => {
$.ajax({
url: 'api/queues/<VHOST>/' + name + '/contents/',
type: 'DELETE',
success: callback
})
}
$.ajax({
url: '/api/queues/',
success: (data) => {
for (queue in data) {
queueName = data[queue].name
if (queueName.startsWith("<NAME OF QUEUE>")){
purgeQueue(queueName)
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment