[openamq-dev] x-match vs X-match

Martin Sustrik sustrik at imatix.com
Thu Feb 7 17:23:58 CET 2008


Hi Esteve,

IIRC the headers exchange haven't been codified in AMQP v0-8 therefore 
AMQP implementations of AMQP v0-8 implement it as an proprietary 
extension and therefore aren't required to be interoperable :(

However, OpenAMQ implements v0-9 and should therefore comply with 0-9 
specification of the headers exchange meaning that it should use 
'x-match' rather than 'X-match'. In other words, there is a bug in 
OpenAMQ, however, unfortunately, fixing it would break existing deployed 
applications. We'll have to deal with the problem in the future somehow.

As for the default value, AMQP spec doesn't specify the default, so if 
you want to write interoperable code you should specify the value 
explicitly. That should work with all AMQP implementations.

Martin

Esteve Fernandez wrote:
> Hi all, I've been playing with headers exchanges and there's a subtle issue. 
> In the AMQP spec it states that:
>
> "The   matching   algorithm   is   controlled   by   a   special   bind   
> argument   passed   as   a   name   value   pair   in   the 
> arguments table. The name of this argument is 'x-­match'."
>
> however, one can find this in server/amq_exchange_headers.c:389:
>
>             if (field->name [0] == 'X' && field->name [1] == '-') {
>                 if (streq (field->name, "X-match")) {
>                     if (streq (asl_field_string (field), "any")) {
>                         if (amq_server_config_debug_route (amq_server_config))
>                             smt_log_print (amq_broker->debug_log,
>                                 "X: select   %s: match=any", 
> self->exchange->name, index_key);
>                         binding->match_all = FALSE;
>                     }
>                 }
>                 else
>                     smt_log_print (amq_broker->alert_log,
>                         "W: unknown field '%s' in bind arguments", 
> field->name);
>             }
>
> which one is the correct one, X-match or x-match?
>
> Also, which is the standard default value for X-match? Qpid uses 'any', 
> whereas OpenAMQ uses 'all'.
>
> Cheers.
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev
>   



More information about the openamq-dev mailing list