qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject Re: how to bind exchange to exchange using C++ broker?
Date Thu, 13 Feb 2014 16:31:08 GMT
Hello,
As has been said Exchange to Exchange binding is not something 
*technically* supported in Qpid however........

I don't actually know how it's implemented in RabbitMQ, but I doubt it's 
truly exchange to exchange, because an exchange (in case you aren't 
aware) has no storage capabilities so how it's *probably* done is to go 
via an internal queue.

As it happens with Qpid it's possible to do federation between two 
brokers (certainly two qpidd instances - not quite sure what the score 
is between qpidd and the Java Broker) now there are actually three 
federation approaches for AMQP 0.10 on qpidd
1) dynamic exchange routes
2) static exchange routes
3) queue routes

The first two of these *logically* link two exchanges on two separate 
brokers (though in practice there is actually a temporary queue 
established because AMQP 0.10 fundamentally has the concepts of 
exchanges, queues and bindings between the two - that's another reason I 
suspect that RabbitMQ has a queue involved somewhere).

Anyway to get to the point.

As it happens the underlying mechanism to create links between brokers 
and establish bridges describing the routes is actually implemented in 
QMF and doesn't (when I tried it) *fundamentally* preclude you from from 
federating from an exchange  on one broker to a different exchange on 
the same broker.

I say *fundamentally* because in practice it's a little harder as the 
main tool you use to do federation is qpid-route and that implemented a 
test to prevent linking a broker to itself.

I've attached three emails from way back in September 2011 the crux of 
which is that I "tweaked" qpid-route to remove this test and 
successfully federated between two exchanges on the same qpidd instance.

A few caveats.
1) This was back in 2011 and so it's possible that changes have been 
made to qpidd to actually prevent this (don't know).
2) Although I got it working I found a different solution so I ended up 
not needing to do this so I haven't really played with it since.
3) It was mildly contentious at the time (I've attached all the mails 
for context and so you can make up your own mind) I personally think 
that it's a reasonable and potentially useful niche feature (and clearly 
so do RabbitMQ) but care needs to be taken as mentioned as circular 
routes could bite you. It might be interesting to revisit this 
discussion more widely (stands back to see who bites :-) )
4) Because this approach (ab)uses federation there is still a socket 
connection established even though it's an intra-broker communication.

Another thought along similar lines:
Are you using AMQP 0.10 or AMQP 1.0 and what broker version are you 
using? Why I ask is that fairly recently as part of qpidd AMQP 1.0 
uplift work a few neat new features have been added to qpidd to make it 
easy to connect to other AMQP 1.0 containers. This involves adding a 
"domain" object via QMF (you can do it via qpid-config) and also an 
"outgoing" (or "incoming") Link object (see 
<qpid>/cpp/src/qpid/broker/management-schema.xml) I've not personally 
played with this stuff yet I'm afraid and I've no idea if any code has 
been put in place to prevent qpidd linking to itself, but if not then I 
*think* that you ought to be able to establish a link between two 
exchanges on the same broker (they are after all simply two addressable 
AMQP 1.0 nodes so I can't see any *fundamental* reason to prevent this). 
It'll still create a subscription queue though - there's really no 
getting away from queues.

As I say I've not tried the approach using the new AMQP 1.0 features and 
the "traditional" federation approach I last tried a couple of years 
back, but it might well still work.


It's a little bit of an edge case and as has been said there's no 
particular support, but perhaps the info here might get you up and 
running and might provoke some more discussion on this use case.

HTH and Regards,
Frase



On 13/02/14 13:03, Robbie Gemmell wrote:
> Exchange to Exchange bindings within a broker is an extension which
> RabbitMQ has implemented. Neither of the Qpid brokers currently support
> this behaviour to my knowledge.
>
> Robbie
> On 13 Feb 2014 10:23, "kevency_poche" <kevencypoche@gmail.com> wrote:
>
>> Thank you Pavel,
>> I gone through these, that's why i asked. please go through these you will
>> get an idea what i am asking.
>>
>> http://www.rabbitmq.com/e2e.html
>>
>> https://www.rabbitmq.com/blog/2010/10/19/exchange-to-exchange-bindings/
>>
>> thank you
>>
>>
>>
>> Pavel Moravec wrote
>>> Hi,
>>> this is not possible. In any case, messages from producers get to an
>>> exchange. The exchange checks what bindings match to the message and then
>>> it enqueues the message to all queues of the bindings that matched. Every
>>> consumer gets a message from queues only.
>>>
>>> You might to set up alternate exchange, but that has a different purpose:
>>> if no binding matches the message, the message is re-routed to the
>>> alternate exchange.
>>>
>>> Hope that helps.
>>>
>>> Kind regards,
>>> Pavel
>>>
>>>
>>> ----- Original Message -----
>>>> From: "kevency_poche" &lt;
>>> kevencypoche@
>>> &gt;
>>>> To:
>>> users@.apache
>>>> Sent: Wednesday, February 12, 2014 9:34:28 AM
>>>> Subject: how to bind exchange to exchange using C++ broker?
>>>>
>>>> Hello everyone..
>>>> Yesterday i learnt how to bind in between queue and exchange. Now i want
>>>> to
>>>> send messages from one exchange to another exchange in the same broker.
>>>> When i try to bind two exchanges it is not allowing. Can any one help me
>>>> out
>>>> ?
>>>>
>>>> Thank you !!
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>>
>> http://qpid.2158936.n2.nabble.com/how-to-bind-exchange-to-exchange-using-C-broker-tp7604322.html
>>>> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>> users-unsubscribe@.apache
>>>> For additional commands, e-mail:
>>> users-help@.apache
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> users-unsubscribe@.apache
>>> For additional commands, e-mail:
>>> users-help@.apache
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://qpid.2158936.n2.nabble.com/how-to-bind-exchange-to-exchange-using-C-broker-tp7604322p7604355.html
>> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>> For additional commands, e-mail: users-help@qpid.apache.org
>>
>>


Mime
View raw message