qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@redhat.com>
Subject Re: [c++ broker] Anyone have a good algorithm for determining if 2 addresses (protocol:host:port) are for the same broker?
Date Mon, 30 Jan 2012 16:52:57 GMT
On Mon, 2012-01-30 at 10:23 -0500, Alan Conway wrote:
> Puzzle for you:
> 
> I want a broker to be able to eliminate its own addresss from a multi-address 
> URL so that it doesn't end up connecting to itself. Anyone got a technique for 
> that? It has to work with IPv4, IPv6, DNS names, /etc/host names and any other 
> way a user is allowed to express a broker address. It has to work for all the 
> protocols the broker supports and it has to work on hosts with multiple NICs.
> 
> Best I can come up with so far is for the broker to connect to all the addresses 
> and send a UUID or some such token, then see if it gets a connection back to 
> itself - if so eliminate the address. Anyone got a simpler solution?

Given the need for broad applicability I think your solution is probably
the only thing that is likely to work - I think there is no way to
figure out if an broker address is you without actually asking the
remote who it is. With one addition to what you've specified - if no
broker is contactable on the address/port then you should make no
assumption about whether or not it is the same broker, as even routes to
yourself can come and go; by the same token you need to make the
determination every time you have to reconnect using the same
address/port.

> 
> Cheers,
> Alan.
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
> 



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


Mime
View raw message