How to set up RabbitMQ default queue type to quorum queue on bootstrap?

1k Views Asked by At

I am trying to install a RabbitMQ cluster on Kubernetes using offical docker image rabbitmq:3.12.5-alpine. I have a init container from where I am overriding the default configurations.

I can see RabbitMQ uses classic mirrored queue by default if a client creates a queue to publish into the nodes. But, This does not ensures persistence without setting certain policies through cli. The data gets deleted once a pod restarts. I want to set quorum queue to be default queue type for the cluster. Is there any way to override this setting from configuration file/environment variable when bootstrapping the cluster? I have checked out the official documentation but could not find any. Thanks in advance!

2

There are 2 best solutions below

0
Luke Bakken On BEST ANSWER

I have checked out the official documentation but could not find any

Actually, the official documentation does answer your question:

https://www.rabbitmq.com/quorum-queues.html#declaring

To declare a quorum queue set the x-queue-type queue argument to quorum (the default is classic). This argument must be provided by a client at queue declaration time; it cannot be set or changed using a policy.

Since this is a per-queue setting that happens at declaration time, there is currently no way to globally make all queues quorum queues.

0
Sergey Ch On

You can set default queue type for vhost https://www.rabbitmq.com/vhosts.html#metadata

rabbitmqctl add_vhost qa1 --description "QA environment 1" --default-queue-type quorum --tags qa,project-a