Reputation: 367
I have a k8s service, using rabbitMQ as message broker. I want to be able to delete a specific queue if the service deployment which may have multiple pods is stopped.
Reading the documentation RabbitMq Queues Docs I found that the best case for me in this case is to use the auto-deleted property of the queue.
Is there any option so the auto-deleted queue will not be deleted immediately after the clients are disconnected, instead to wait some seconds to wait for reconnection ?
Upvotes: 3
Views: 874
Reputation: 950
Set expires policy on queues as per https://www.rabbitmq.com/ttl.html#queue-ttl.
rabbitmqctl set_policy ZeroConsumerQueExpiry "myProjectQueue.*" '{"expires":10000}' --apply-to queues
It will support your use case in following ways
There will be a difference in using auto-delete vs expires policy
Upvotes: 0