On 10/22/2009 09:10 AM, Gordon Sim wrote:
On 10/21/2009 08:48 PM, Alan Conway wrote:
Currently there is functionality built-in to client::Connection to check
if there's an amq.failover exchange, and if there is to subscribe for
updates. This is exposed to the user as
client::Connection::getKnownBrokers() which returns the updated set of
brokers in the cluster.
I sorely regret building this in to client::Connection as has been
nothing but trouble. Currently it's causing sporadic memory leaks. It
also does extra work on _every_ Connection::open that is entirely
useless if you're not talking to a qpid C++ clustered broker.
I'd like to take it out and provide the functionality as a separate
class that users can employ if they actually want this functionality.
Could this alternative mechanism also be used to provide the same
semantics for the existing Connection::getKnownBrokers() call?
Yes, I envision the following code change
// Old code
Connection c;
...
c.getKnownBrokers() // get latest list
// New code
Connection c;
FailoverListener fl(c);
...
fl.getKnownBrokers() // get latest list
However I see there is a bunch of automatic re-connection coe in
ConnectionImpl.cpp. It looks like we automatically attempt to connect using
getKnownBrokers if the plain URL doesn't work. I think this would also have to
be moved to another class (FailoverManager?) to get the FailoverListener out of
Connection. I'd like to go over this logic before I proceed, can you ping me
when you have time?
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]