Does queue mirroring policy only apply to newly-created queues?

216 views
Skip to first unread message

Tony2020

unread,
Feb 10, 2020, 12:18:16 PM2/10/20
to rabbitmq-users
the policy won't be applied to existing queues? let's say i have some queue already and then set_policy, it won't have any effect until some new queue is created?

Luke Bakken

unread,
Feb 10, 2020, 1:24:45 PM2/10/20
to rabbitmq-users
Hello,

The policy will apply to existing queues if the queues match the policy's regular expression.

Thanks,
Luuke

Tony2020

unread,
Feb 11, 2020, 12:45:31 AM2/11/20
to rabbitmq-users
thanks. I am seeing that the policy wasn't working. e.g. i have a queue with name "clusterd.any" and i used following policy
set_policy ha_two "clusterd\.any" {"ha_mode" : "exactly, "ha_params": ...} 
and i don't see the policy being applied (from management UI) and there was no acknowledge about creating mirror in the log. 

what could be wrong? something due to the queue itself? 

Luke Bakken

unread,
Feb 11, 2020, 10:34:20 AM2/11/20
to rabbitmq-users
Hello,

At this point you need to use the rabbitmqctl command to list your queues and policies to ensure there isn't stray whitespace or some other small mistake.

Capture the output and attach it to your response. You can also run rabbitmqctl report and attach that. It will list a lot of information we can use to help.

Thanks,
Luke

Tony2020

unread,
Feb 11, 2020, 4:49:17 PM2/11/20
to rabbitmq-users
Thanks! 
Here is what I :

1. sudo ./rabbitmqctl set_policy ha-two "clusterd\.any" '{"ha-mode":"exactly", "ha-params":2, "ha-sync-mode":"automatic"}'
2.  sudo ./rabbitmqctl list_policies
/opt/usr/rabbitmq_server-3.7.4/etc/rabbitmq/rabbitmq-env.conf: line 9: ulimit: open files: cannot modify limit: Invalid argument
Listing policies for vhost "/" ...
/ ha-two clusterd\.any all {"ha-mode":"exactly","ha-params":2,"ha-sync-mode":"automatic"} 0

3.sudo ./rabbitmqctl list_queues
Listing queues for vhost / ...
workflowd.any 0
clusterd.any 0

4. sudo ./rabbitmqctl report
.my_workqueues exchange clusterd.any queue clusterd.any []

Luke Bakken

unread,
Feb 11, 2020, 5:59:19 PM2/11/20
to rabbitmq-users
Hello,

The output of rabbitmqctl report is missing a lot of information. Please run sudo -i first, then rabbitmqctl report.

Please redirect the output to a file and attach the file.

You should not put the ulimit command in rabbitmq-env.conf. It should be run as part of whatever init scripts or other scripts you use to start RabbitMQ.

Thanks,
Luke

Tony2020

unread,
Feb 11, 2020, 8:04:21 PM2/11/20
to rabbitmq-users
Luke,
Please attached. 
Really appreciate your help.
The report seemed to indicate clusterd.any has a mirroring policy (although list_queues don't show that, as well as from the UI). 
sometimes when it worked, i do remembered seeing that from 'list_queues' output
rabbitmq_report.txt

Luke Bakken

unread,
Feb 11, 2020, 8:30:57 PM2/11/20
to rabbitmq-users
Hi Tony,

If you run rabbitmqctl list_queues you have to add extra arguments to see the applied policy (the extra arguments choose the output data):

rabbitmqctl list_queues name policy

See rabbitmqctl help list_queues for information.

It looks as though the ha-two policy is being applied. I suspect there must be an old bug preventing you from seeing it in the UI. Please try upgrading to 3.7.23 or 3.8.2

Thanks,
Luke

Tony2020

unread,
Feb 11, 2020, 10:35:31 PM2/11/20
to rabbitmq-users
Thanks! Luke.
yes, now I am seeing the policy attached to the queue by running 'list_queues name policy". I am using 3.7.4Erlang 20.3, i will try upgrade to 3.8.2 to see if UI can show it as well. I do remembered I did see that from UI several times but not always, so it could be a bug there.Tony

Michael Klishin

unread,
Feb 28, 2020, 7:18:03 PM2/28/20
to rabbitmq-users
Effective policy in management UI is a column that can be hidden (and probably is by default). See the +/- button that controls what columns are displayed.

--
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/8fd0a9a2-24bf-4733-abeb-72a14cadf716%40googlegroups.com.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages