How can I implement a queue with configurable x-message-ttl?
I have a queue with x-message-ttl set to 1 minute and I want to change it to 2 minute at runtime. How can this be achieved?
I already tried declaring queue again with x-message-ttl = 2 minutes but neither ttl is changing by this nor message is being published.
if you create a queue with arguments x-message-ttl
you can't change it, you have to remove and recreate the queue.
but you can use the policies:
rabbitmqctl set_policy expiry ".*" "{""expires"":1800000}" --apply-to queues
In this way you can change the queue TTL value
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With