Just had a closer look: the exchange itself is lazy, but the 0-10 session won't allow bindings to a headers exchange without an x-match arg.
Robbie > -----Original Message----- > From: Robbie Gemmell [mailto:[email protected]] > Sent: 06 September 2010 17:13 > To: [email protected] > Subject: Re: x-match arguments and the 0-10 Java client > > On 6 September 2010 16:46, Gordon Sim <[email protected]> wrote: > > On 09/06/2010 04:20 PM, Robbie Gemmell wrote: > >> > >> Hi all, > >> > >> I would like to flag up a recent change I made for comment. > >> > >> In order to update the patch for QPID-2418 to allow the 0-10 Java > >> client to properly handle DurableSubscriptions in the face of > >> adding/removing/changing selectors for a given subscription name, I > >> had to remove an arbitrary addition of the x-match argument to the > >> bindings created by the 0-10 client (see below). This was corrupting > >> the arguments sent to the broker and was not added when performing > >> checks using isBound(), so I was seeing apparent failures to match > >> arguments I (thought I) had just bound. > >> > >> The only reason I know for this to be there is so that users dont > need > >> to specify an option when using eg the Headers Exchange. As this is > a > >> required option im not sure adding it for them is the correct > >> behaviour, but if this is truly the desired outcome then i think it > >> should be performed by making the broker lenient to its exclusion > >> rather than the other way around. I note the the C++ broker plays > >> hardball in this situation and demands the value be set. > > > > Yes, the "headers_exchange_requires_match_arg" rule in the spec > states: > > > > When creating a binding between an exchange E, of type > > headers and any queue Q the arguments field MUST contain > > a key "x-match" to a value of type str8 which must equal > > either "any" or "all". If the arguments field does not > > contain a key "x-match" then an exception of type > > invalid-argument MUST be raised. > > > > However as far as I'm aware, none of the other clients add it by > default. > > I'm not sure I see much value in the code you have removed, > especially given > > the problems you point out. > > > > Does the java broker have a default if no explicit x-match is > specified? > > Reading the spec on this would have cleared that right up, oops, glad > to hear the other clients arent doing it though :) > > I think it defaults to 'all' in the Java broker thanks to Java > initialisation defaults, plus im not sure think the 0-9 spec is quite > as clear on what the behaviour should be anyway so it is probably just > historically lazy. Dont think anyone is really using it anyway. > > Robbie > > > > > --------------------------------------------------------------------- > > Apache Qpid - AMQP Messaging Implementation > > Project: http://qpid.apache.org > > Use/Interact: mailto:[email protected] > > > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
