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.
Asked
Active
Viewed 428 times
0
-
Can you give some information about "Q expire policy"? – Nabin Sep 21 '16 at 04:47
-
Queue should get deleted within 1 min,, https://www.rabbitmq.com/ttl.html ,,, rabbitmqctl set_policy expiry ".*" '{"expires":60000}' --apply-to queues – Akshat Sep 21 '16 at 05:19
-
Please update the question to make it more clear – Nabin Sep 21 '16 at 05:43
1 Answers
2
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

Gabriele Santomaggio
- 21,656
- 4
- 52
- 52