qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fadams <fraser.ad...@blueyonder.co.uk>
Subject Re: Syntax For Creating Static Route with Headers Exchange
Date Fri, 15 Jul 2011 14:55:23 GMT
Hi Richard,
You may have already figured this out, but in case not...

You have been trying to create a static route haven't you, I think you've
been playing with dynamic routes too and found a bug with propagating
headers bindings (works with x-match any but not x-match all) I think Gordon
has fixed that and the fix is due in the 0.12 broker.

Either way, static and dynamic routes are both exchange routes as I'm sure
you know. Although exchange routes are useful internally, creating an
exchange route creates a private queue (auto-delete, exclusive) on the
source broker to hold messages that are to be routed to the destination
broker, binds this private queue to the source broker exchange, and
subscribes the destination broker to the queue.

The down side of this is that you've got no real control over the queue that
gets created, so as well as being a private temporary queue it will also
have the --default-queue-limit of the source broker and limit policy of
reject. So by default large messages will cause your federation to go bang
and if your destination broker goes down (or someone forgets to set a ring
queue on a consumer and blows the link :-)) all the messages from the source
fall all over the floor.

Depending on your circumstances another disadvantage might be (lack of) load
balancing where you might want multiple destination brokers connecting to a
non exclusive queue on the source broker to share the load of message

It's worth looking at queue routes. I've tried this out and it works
absolutely fine for headers exchange. So I set up a queue on the source
broker with my chosen config (I set --max-queue-size=500000000
--limit-policy=ring) and created a binding (in actual fact I cheated a bit
to test this out quickly by temporarily connecting my end consumer to the
source broker to create a named queue with config plus the binding, then I
disconnected leaving the queue). I then connected my consumer to the
destination broker and fired up the producer.

Of course at that point no messages flow, but then doing: (where myqueue is
the output queue from the source broker)..

qpid-route queue add localhost:5673 localhost:5672 amq.match myqueue

And bingo messages flow merrily from source to destination,which is
subscribing using an x-match all binding to amq.match :-) this, I believe,
is the result you want to achieve.

Obvious disadvantages of queue routes are the need to establish a queue on
the source broker and a binding, though clearly that's easy to do with
qpid-config. If you've got a complex topology and are scripting your
qpid-route it's not too much hardship to add a qpid-config line too.

Alternatively it may not be too hard to modify qpid-route to take an address
that can be used to create the queue & binding on the source broker (might
take a bit of copy & paste reuse from qpid-config).

I don't know if the underlying QMF create bridge method supports adding a
headers type binding (possibly not it looks like it only takes a binding key
as a parameter) however I suspect that it *just may* be possible to get
equivalent behaviour to a static route by creating an address on the source
broker using a temporary non durable queue and a headers binding, making
sure you specify a binding key. You can then use QMF to find the queue that
has a binding matching that key, and knowing that (which will be the name of
the temporary queue) you can establish a queue route.

I have to say I've not tried that, but I might have a play if I get a bit of

I hope that this all makes sense and is some help to you.


Gordon Sim wrote:
>> qpid-route route add DEST_BROKER SRC_BROKER amq.match @@MYBINDINGKEY@@
>> What should the value of @@MYBINDINGKEY@@ be?
> The binding key isn't relevant to matching/routing with the headers 
> exchange.
> Looking at the qpid-route options at present, I don't believe it is 
> possible to create a static route from a headers exchange.

View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/Syntax-For-Creating-Static-Route-with-Headers-Exchange-tp6583752p6587147.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message