AVK
AVK

Reputation: 213

How to delete all the queues in RabbitMQ using AMQP-CPP library

I want to delete all the queues present in RabbitMQ server using AMQP-CPP library.

I could not find any methods in AMQP-CPP library that gives the list of queues / deletes all the queues present (if we are not specifying the queue name).

Could you please let me know if there are any possible ways to do this?

Upvotes: 1

Views: 409

Answers (1)

The AMQP protocol doesn't have a method to list resources in a broker.

With RabbitMQ, you can use the REST API provided by the management plugin:

  • To list all queues accross all vhosts:

    GET /api/queues
    
  • To delete a queue in a given vhost:

    DELETE /api/queues/$vhost/$name
    

    This step can be done using AMQP too.

See the complete list of REST endpoints for more information.

Upvotes: 1

Related Questions