Search code examples
rabbitmqrabbitmqctl

Apply Q expire Policy for all Vhosts in RabbitMQ


I need to apply Q expire Policy for all Vhosts in RabbitMQ,Is there any way we can apply a policy for all Vhosts from commandline.


Solution

  • There is no.

    you could write a script like this:

    for i in `rabbitmqctl list_vhosts`; do
    rabbitmqctl -p $i  set_policy expiry "" '{""expires":60000"}' --apply-to queues
    done;
    

    I think you have to skip the first two values