All,
I've moved this thread to the user list. It started out on the back of
an email conversation between Rob Godfrey. Gordon Sim and and myself
when I couldn't get my QMF messages routed on the Java Broker.
The original context was that I was sending messages to
qmf.default.direct and setting the message subject to "broker", this is
pretty much exactly what the python qpid tools such as qpid-config do.
in AMQP 0.10 this works fine because the subject (which in AMQP 0.10 is
a user property called qpid.subject) gets treated as the routing key
when sent to a direct exchange.
When I did my AMQP 1.0 JavaScript qpid-config port I set the AMQP 1.0
subject (which is now an immutable message property and not an
application property) to "broker" and sent to
amqp://guest:guest@localhost:5673/qmf.default.direct
This worked fine with the C++ broker, but with the Java Broker the
message wasn't routed and in subsequent conversations with Rob and
Gordon I discovered that the Java Broker doesn't route on direct
exchanges based on Subject rather it first tries to use to "to" - in
other words if I sent to
amqp://guest:guest@localhost:5673/qmf.default.direct/broker it'd work or
if the to isn't set it uses the application property "routing-key".
So basically this thread is around an inconsistency between the C++ and
Java Brokers where the C++ Broker continues to route on Subject for AMQP
1.0 but the Java Broker does not.
Rob and Gordon can fill in if I've missed anything, but it's probably
best to share this discussion on the user list.
Frase
On 29/08/14 14:03, Rob Godfrey wrote:
I think in the context of where AMQP 1.0 is now, routing by subject is
somewhat counter-intuitive, though when we started we did see the
subject field in a routing-key sort of role.
From my perspective I'd say exactly the opposite, that is routing by
subject seems entirely intuitive and is also consistent with what
happened with AMQP 0.10. Given the use of subject as the defacto routing
key on all of the python tools I don't think I'm alone in feeling that's
intuitive. I'm pretty sure that the subject is used for routing on topic
exchanges so I'm not sure why you think its counter-intuitive on derect
exchanges?
In terms of current behaviour - the legacy filters in the Java Broker
just set up the bindings between the queue and the exchange and thus
use the same routing as previously described (i.e. they're not
currently using subject). Inside the Java Broker an exchange routes
based on an abstract notion of the "routingAddress" of a message
instance. In AMQP 0.x that's taken to be the routing key. In 1.0 it
is as I described in my previous mail.
If we collectively (and this discussion should really be on the users
list) think that 0.x exchanges should route on subject when routing a
1.0 message then I'm happy to change the default behaviour of the Java
Broker - except for the "no name" exchange which will route on "to"
because that's what we're defining on the addressing spec. I'll then
probably add options to the exchange implementation so that a user can
configure on a per exchange basis to route on something else (except
for the non default amq.* exchanges).
-- Rob
On 29 August 2014 13:45, Gordon Sim <[email protected]
<mailto:[email protected]>> wrote:
On 08/29/2014 11:49 AM, Rob Godfrey wrote:
For the moment I guess we'll just have to live with the C++
and Java
Brokers having different ideas about how to route 1.0 messages
at exchanges.
The legacy-amqp filters are defined to work on the subject when
using the exchange as the source. I thought the java broker
supported those?
If I create a receiving link from amq.direct with a
apache.org:legacy-amqp-direct-binding:string of foo, then send a
message to amq.direct whose subject is foo, my expectation would
be that the receiver will receive that.