I'm surprised that calling Connection.stop() doesn't abort failover. Nevertheless, to abort failover I believe you can just return false from org.apache.qpid.jms.ConnectionListener.preFailover(). I guess your implementation would return false if the application was trying to shut down.
I don't think the behaviour of ConnectionListener is very well documented so the best reference I can find is the source code itself: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java?revision=1460483&view=markup Phil On 26 July 2013 09:59, pela <mpela.ga...@gmail.com> wrote: > Hi, > > The number of retries has been configured to an arbitrary high number, my > application should not give up but just retry forever until stopped by the > user. > > Let me explain futher, the problem can come in two flavors: > > 1) I call the createConnection() on the factory, but the connection cannot > be established. QPID starts its retry loop. The user tries to stop the > application, but I don't know how to stop QPID from looping (the > createConnection() hasn't yet returned so I can't even call close() ). > > 2) The connection can be established successfully, but it gets lost at some > point. QPID starts its retry loop in its own thread. When the user tries to > stop the application, I call stop() on the connection, but QPID doesn't > exit. > > Do you have any idea? > > Thanks > Marco > > > >