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:[email protected] > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
