<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>Someone recently asked me a question about finding a named exchange without specifying the type in the declare method call. I've done some testing against RabbitMQ v1.7.0 and it seems that you cannot re-declare an existing exchange without supplying a type argument, even if the passive argument is used and set to true. I consistently get a 503 error.</div><div><br></div><div>The 0-9-1 AMQP XML spec suggests that if you set the passive argument to true in the exchange declare method call, then type should be ignored.</div><div><br></div><div>==== &nbsp;Start of excerpt from 0-9-1 spec ====</div><div><pre><div class="line" id="LC1208"><span class="nt">&lt;field</span> <span class="na">name =</span> <span class="s">"passive"</span> <span class="na">domain =</span> <span class="s">"bit"</span> <span class="na">label =</span> <span class="s">"do not create exchange"</span><span class="nt">&gt;</span></div><div class="line" id="LC1209">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;doc&gt;</span></div><div class="line" id="LC1210">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If set, the server will reply with Declare-Ok if the exchange already</div><div class="line" id="LC1211">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exists with the same name, and raise an error if not.  The client can</div><div class="line" id="LC1212">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use this to check whether an exchange exists without modifying the</div><div class="line" id="LC1213">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server state. When set, all other method fields except name and no-wait</div><div class="line" id="LC1214">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are ignored.  A declare with both passive and no-wait has no effect.</div><div class="line" id="LC1215">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Arguments are compared for semantic equivalence.</div><div class="line" id="LC1216">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="nt">&lt;/doc&gt;</span></div><div class="line" id="LC1216"><br></div><div class="line" id="LC1216"><span class="Apple-style-span" style="font-family: Helvetica; white-space: normal; ">==== &nbsp;End of excerpt from 0-9-1 spec ====</span></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Firstly, can anyone confirm that the behaviour I am observing regarding arguments passed in the exchange declare method is correct. There could be a problem with my client library that I haven't found.</span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Secondly, if the type argument is mandatory even when the passive argument is used and set to true, is this a bug in RabbitMQ?</span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Regards,</span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></div><div class="line" id="LC1216"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Chris</span></font></div><div class="line" id="LC1216"><br></div></pre></div></body></html>