Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 98327 invoked from network); 14 Sep 2009 13:44:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Sep 2009 13:44:16 -0000 Received: (qmail 4514 invoked by uid 500); 14 Sep 2009 13:44:16 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 4465 invoked by uid 500); 14 Sep 2009 13:44:16 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 4456 invoked by uid 99); 14 Sep 2009 13:44:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 13:44:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 13:44:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 74EA323888CB; Mon, 14 Sep 2009 13:43:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r814639 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java Date: Mon, 14 Sep 2009 13:43:54 -0000 To: commits@activemq.apache.org From: rajdavies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090914134354.74EA323888CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rajdavies Date: Mon Sep 14 13:43:54 2009 New Revision: 814639 URL: http://svn.apache.org/viewvc?rev=814639&view=rev Log: Fix for https://issues.apache.org/activemq/browse/AMQ-2385 Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java?rev=814639&r1=814638&r2=814639&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java Mon Sep 14 13:43:54 2009 @@ -762,7 +762,15 @@ } } } - long reconnectAttempts = firstConnection ? this.startupMaxReconnectAttempts : this.maxReconnectAttempts; + int reconnectAttempts = 0; + if (firstConnection) { + if (this.startupMaxReconnectAttempts != 0) { + reconnectAttempts = this.startupMaxReconnectAttempts; + } + } + if (reconnectAttempts==0) { + reconnectAttempts = this.maxReconnectAttempts; + } if (reconnectAttempts > 0 && ++connectFailures >= reconnectAttempts) { LOG.error("Failed to connect to transport after: " + connectFailures + " attempt(s)"); connectionFailure = failure;