RabbitMQ Queues HA and Dead Letter Exchanges Not Working

375 views
Skip to first unread message

Stephen Daniel

unread,
Jun 8, 2016, 1:15:58 AM6/8/16
to rabbitmq-users
Hi, I have 3 nodes (A,B,C) in my cluster . Right now I want to configure the queue High Availability using the ha-nodes option with nodes A and C as the param.
I am successfully configured the HA policy and its working. But after I use the DLX policy for all queues, the HA policy is not working anymore. 
Is that normal or am I missing something here?
I want to use the HA policy and DLX policy together, but now it seems impossible. Thanks.

Jean-Sébastien Pédron

unread,
Jun 8, 2016, 6:25:12 AM6/8/16
to rabbitm...@googlegroups.com
On 08/06/2016 07:15, Stephen Daniel wrote:
> Hi,

Hi!

> I am successfully configured the HA policy and its working. But after I
> use the DLX policy for all queues, the HA policy is not working anymore.
> Is that normal or am I missing something here?

Only one policy is applied at a time for a given queue or exchange:
http://www.rabbitmq.com/parameters.html#policies

But you still can configure HA and dead-lettering together: you just
need to do that in one policy. Here is an example:

{
"ha-mode": "nodes",
"ha-params": ["A", "C"],
"dead-letter-exchange": "my-dlx"
}

--
Jean-Sébastien Pédron
Pivotal / RabbitMQ

Stephen Daniel

unread,
Jun 8, 2016, 7:35:15 AM6/8/16
to rabbitmq-users, jean-se...@rabbitmq.com
Hi, thanks so much, I missed that part :) Its working just fine now after I change the policy config just as you mention. Really appreciate your help.

Gregg Fiehler

unread,
Sep 10, 2016, 2:53:22 PM9/10/16
to rabbitmq-users, jean-se...@rabbitmq.com
Can you post the policy you used, I just tried this both via the UI and rabbitmqctl and it does not work.  Here is my policy

rabbitmqctl set_policy ha-all-dlx ".*" '{"ha-mode": "all", "dead-letter-exchange": "xDLX"}' --priority 1 --apply-to queues

ha-mode is set and shows master and slaves, but DLX will not set.

I have tried this in both rabbitmq 3.6.1 and 3.6.2.  I have now also tried just setting a policy for dead-letter-exchange only 

rabbitmqctl set_policy dlx ".*" '{"dead-letter-exchange": "xDLX"}' --priority 1 --apply-to queues

and that also does not work.  If I set dead-letter-exchange explicitly when creating a queue, it does work.  But I cannot get any policy to set dead-letter-exchange.  

I am hoping I am just making a mistake that I am not seeing, any help would be greatly appreciated.

Gregg
Reply all
Reply to author
Forward
0 new messages