[rabbitmq-discuss] How to declare mirrored queue using pika?

HongXuan Ji hxuanji at gmail.com
Tue Nov 19 06:57:28 GMT 2013


Hi all,

I am wondering how to declare a mirrored queue through the code level. I 
use the following code to declare the queue.


queue_args = {"x-ha-policy" : "all" } #/(hwcmq.4) Set queue mirroring policy
> channel.queue_declare(queue="hello-queue", arguments=queue_args) #/(hwcmq.5) 
> Declare the queue


 which is referenced from 
the https://github.com/rabbitinaction/sourcecode/blob/master/python/chapter-5/hello_world_mirrored_queue_consumer.py.

And after the operation, the "hello-queue" on the management interface 
shows :

<https://lh6.googleusercontent.com/-3l9fEvEOwlk/UosKOZEthyI/AAAAAAAAAfY/b99UIQhIrPI/s1600/Untitled.png>


I am not sure I succeed or not. Because I try the different way to delcare 
mirrored queue by the command:

rabbitmqctl set_policy ha-all "^ha\." '{"ha-mode":"all"}'

which is reference from the official page. And the result is more convinced 
which shows "ha-all" in the Policy field when I declare some queue whose 
name is prefixed by "ha.". And I also do some tests on it. it seems work.

So I am wondering the simply adding parameter in the python command: *queue_declare 
*like the first paragraph is effective or not?

Any idea?

Regards,

Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131118/629991f8/attachment.htm>


More information about the rabbitmq-discuss mailing list