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.
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