Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D99D107D8 for ; Fri, 26 Jul 2013 13:40:28 +0000 (UTC) Received: (qmail 33576 invoked by uid 500); 26 Jul 2013 13:40:28 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 33554 invoked by uid 500); 26 Jul 2013 13:40:26 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 33543 invoked by uid 99); 26 Jul 2013 13:40:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jul 2013 13:40:25 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: encountered temporary error during SPF processing of domain of mpela.gatti@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jul 2013 13:40:20 +0000 Received: from jim.nabble.com ([192.168.236.80]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1V2iF9-0000Ju-Ae for users@qpid.apache.org; Fri, 26 Jul 2013 06:39:39 -0700 Date: Fri, 26 Jul 2013 06:39:39 -0700 (PDT) From: pela To: users@qpid.apache.org Message-ID: <1374845979323-7595945.post@n2.nabble.com> In-Reply-To: References: <1374750372276-7595882.post@n2.nabble.com> <1374826919217-7595930.post@n2.nabble.com> <1374829165493-7595932.post@n2.nabble.com> Subject: Re: Java client: Cannot stop during failover ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Connection.stop() and close() don't seem to help. Returning false from preFailover() is not a solution because that is invoked once before the start of a failover, but my problem is when the failover is already started when you try to shut down. I'm starting to think I'll have to give up with the automatic failover, and implement a reconnection logic myself... Thanks Marco Phil Harvey-2 wrote > 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.gatti@ > > 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 >> >> >> >> -- View this message in context: http://qpid.2158936.n2.nabble.com/Java-client-Cannot-stop-during-failover-tp7595882p7595945.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