x-message-ttl update

419 views
Skip to first unread message

disvw266

unread,
Feb 2, 2023, 6:13:02 PM2/2/23
to rabbitmq-users
Hello rabbitmq-users,

My question is this relate too RabbitMQ 3.9.16 on Erlang 23.3.4.7. I'm attempting to increase the x-message ttl of several queues to 86400000 (24hrs). I've been able to do this by deleteing the vhost and import a new json.  Which resulted in data lost and empty message queues. I'm updating the json file from CLI, the entire file with the bindings, exchanges, queues, vhost, etc.  Is this necessary? Can I make a new json file, insert my changes needed and import_definitions?  I want to keep the cluster up, have no down time, may put in MA mode.  The messages in the queue to move to another node in my 5 node cluster.

 <queue>  | true    | {<<"x-message-ttl">>,long,7200000}{<<"x-queue-mode">>,longstr,<<"lazy">>}{<<"x-queue-type">>,longstr,<<"classic">>} | ha-all |

What would you recommend to allow me to successfully perform the update?  Without impacting the other queues? 

Michal Kuratczyk

unread,
Feb 3, 2023, 4:59:26 AM2/3/23
to rabbitm...@googlegroups.com
Hi,

Policies allow you to set TTL and other values and easily change them at runtime:
https://www.rabbitmq.com/parameters.html

Note, you are using classic mirrored queues (ha-all policy), you should move to quorum queues as classic queue mirroring will be removed soon.

Best,

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/6b48d344-8c78-4236-b5ff-0c1015509308n%40googlegroups.com.

--
Michał
RabbitMQ team
RabbitMQ team

disvw266

unread,
Feb 3, 2023, 8:30:44 AM2/3/23
to rabbitmq-users

I tried to update the queue and get the following message.

rabbitmqctl set_policy TTL -p "vhosts" queuename '{"x-message-ttl",long,60000}' --apply-to queues

Error:
JSON decoding error. Reason: badarg

Michal Kuratczyk

unread,
Feb 3, 2023, 8:51:27 AM2/3/23
to rabbitm...@googlegroups.com
Because that's not valid JSON. Check the example here: https://www.rabbitmq.com/ttl.html



--
Michał
RabbitMQ team
Reply all
Reply to author
Forward
0 new messages