<div dir="ltr">Hi all,<div><br></div><div>I am wondering how to declare a mirrored queue through the code level. I use the following code to declare the queue.</div><blockquote><br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class="n">queue_args</span> <span class="o" style="font-weight: bold;">=</span> <span class="p">{</span><span class="s" style="color: rgb(221, 17, 68);">"x-ha-policy"</span> <span class="p">:</span> <span class="s" style="color: rgb(221, 17, 68);">"all"</span> <span class="p">}</span> <span class="c" style="color: rgb(153, 153, 136); font-style: italic;">#/(hwcmq.4) Set queue mirroring policy<br></span><span class="n">channel</span><span class="o" style="font-weight: bold;">.</span><span class="n">queue_declare</span><span class="p">(</span><span class="n">queue</span><span class="o" style="font-weight: bold;">=</span><span class="s" style="color: rgb(221, 17, 68);">"hello-queue"</span><span class="p">,</span> <span class="n">arguments</span><span class="o" style="font-weight: bold;">=</span><span class="n">queue_args</span><span class="p">)</span> <span class="c" style="color: rgb(153, 153, 136); font-style: italic;">#/(hwcmq.5) Declare the queue</span></blockquote></blockquote><div><br></div><div>&nbsp;which is referenced from the&nbsp;https://github.com/rabbitinaction/sourcecode/blob/master/python/chapter-5/hello_world_mirrored_queue_consumer.py.</div><div><br></div><div>And after the operation, the "hello-queue" on the management interface shows :</div><div><br></div><p class="separator" style="text-align: center; clear: both;"><a imageanchor="1" href="https://lh6.googleusercontent.com/-3l9fEvEOwlk/UosKOZEthyI/AAAAAAAAAfY/b99UIQhIrPI/s1600/Untitled.png" style="margin-left: 1em; margin-right: 1em;"><img src="https://lh6.googleusercontent.com/-3l9fEvEOwlk/UosKOZEthyI/AAAAAAAAAfY/b99UIQhIrPI/s400/Untitled.png" border="0" width="400" height="50" style=""></a></p><div><br></div><div><br></div><div>I am not sure I succeed or not. Because I try the different way to delcare mirrored queue by the command:</div><div><br></div><div>rabbitmqctl set_policy ha-all "^ha\." '{"ha-mode":"all"}'<br></div><div><br></div><div>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.</div><div><br></div><div>So I am wondering the simply adding parameter in the python command: <b>queue_declare </b>like the first paragraph is effective or not?</div><div><br></div><div>Any idea?</div><div><br></div><div>Regards,</div><div><br></div><div>Ivan</div></div>