Thanks Fraser,
We are using the C++ broker - selectors working client side is ok for us, but
even so I would be wary of implementing features that are not supported. That
said, it seems a pretty harmless hack and taking care not to create a binding
loop would actually be trivial in our particular case... so I guess I'll sleep
on it ;)
Any insight on my second question? Is there a simpler way to bind/unbind a
queue to multiple exchanges?
thanks again,
Matthew
-----Original Message-----
From: "Fraser Adams" <[email protected]>
Sent: Wednesday, May 2, 2012 2:36pm
To: [email protected]
Subject: Re: Messaging Flow Design in Qpid
Hi Matthew,
I think that "technically" the answer is "no" however you could use
federation (with a little teeny bit of tweaking).
So it's possible to use qpid-route to federate between two brokers
however there's a line in qpid-route that throws an exception if you try
to do this -it moans about linking on the same host.
However...... the broker actually happily allows this.
I hacked the qpid-route addLink method thus...
def getLink(self):
links = self.agent.getObjects(_class="link")
for link in links:
if self.remote.match(link.host, link.port):
return link
return None
def addLink(self, remoteBroker, interbroker_mechanism=""):
self.remote = BrokerURL(remoteBroker)
#if self.local.match(self.remote.host, self.remote.port):
# raise Exception("Linking broker to itself is not permitted")
brokers = self.agent.getObjects(_class="broker")
broker = brokers[0]
link = self.getLink()
if link == None:
So literally just commented out the test for self.local.match and the
raise Exception and it works - one can federate from one exchange to
another on the same broker.
It's slightly controversial :-) but I wanted to see if it was possible.
You'd want to be careful to avoid circular routes etc.
But this approach might be what you're looking for unless someone can
come up with a better mechanism.
BTW federation only works with the C++ broker IIRC correctly so this
might be an issue for you I believe that you were planning on using the
Java broker (which gives you broker side message selectors) :-/
Frase
On 02/05/12 18:42, [email protected] wrote:
> Hi All,
>
> Thanks for all your help with the selector questions that I had last week.
> We are conducting more tests to see if Qpid is the solution for our
> architecture but we have some doubts...Our flow requires that exchanges
> subscribe to exchanges and queues in turn subscribe to multiple exchanges.
>
> 1) Is it possible to bind Exchanges to Exchanges? I have seen some posts
> giving an emphatic NO:
> ([http://qpid.2158936.n2.nabble.com/how-to-bind-exchange-to-exchange-like-bind-exchange-to-queue-in-the-same-broker-td6385448.html]
>
> http://qpid.2158936.n2.nabble.com/how-to-bind-exchange-to-exchange-like-bind-exchange-to-queue-in-the-same-broker-td6385448.html)
>
>
> 2) The x-binding syntax , that I have encountered, for binding a queue to
> multiple exchanges seems a little convoluted and the last time I asked you
> guys for help I discovered wonderful new simplified classes and methods :).
> Is the following example the best practice for creating multiple bindings?
>
> x-bindings:[{queue:MYQUEUE,exchange:'FIRST_EXCHANGE',key: 'binding1',
> arguments:{'x-match':any,'a':'10'}}, { queue:MYQUEUE
> ,exchange:'SECOND_EXCHANGE',key: 'binding2', arguments:
> {'x-match':any,'a':'10'}}]
>
> If so I would need to persist the "binding keys" (binding1, binding2) in
> order to remove the bindings later.
>
>
>
> thanks for all your help,
> Matthew
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]