<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>==== Start of excerpt from 0-9-1 spec ====</div><div><pre><div class="line" id="LC1208"><span class="nt"><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">></span></div><div class="line" id="LC1209"> <span class="nt"><doc></span></div><div class="line" id="LC1210"> If set, the server will reply with Declare-Ok if the exchange already</div><div class="line" id="LC1211"> exists with the same name, and raise an error if not. The client can</div><div class="line" id="LC1212"> use this to check whether an exchange exists without modifying the</div><div class="line" id="LC1213"> server state. When set, all other method fields except name and no-wait</div><div class="line" id="LC1214"> are ignored. A declare with both passive and no-wait has no effect.</div><div class="line" id="LC1215"> Arguments are compared for semantic equivalence.</div><div class="line" id="LC1216"> <span class="nt"></doc></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; ">==== 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>