Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 60D8D18699 for ; Wed, 2 Sep 2015 20:38:02 +0000 (UTC) Received: (qmail 46944 invoked by uid 500); 2 Sep 2015 20:38:02 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 46902 invoked by uid 500); 2 Sep 2015 20:38:02 -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 46893 invoked by uid 99); 2 Sep 2015 20:38:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Sep 2015 20:38:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0A454DFC7F; Wed, 2 Sep 2015 20:38:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: <1d93f0ea8293494681c1c37b5b94e2fd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: activemq git commit: AMQ-5949 Treat maxSendRetries of -1 as infinite. (cherry picked from commit 505916b92797035c6c41174f220d9e9c9f669b79) Date: Wed, 2 Sep 2015 20:38:02 +0000 (UTC) Repository: activemq Updated Branches: refs/heads/activemq-5.12.x b5663bb0a -> 4e32f1e2d AMQ-5949 Treat maxSendRetries of -1 as infinite. (cherry picked from commit 505916b92797035c6c41174f220d9e9c9f669b79) Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/4e32f1e2 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/4e32f1e2 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/4e32f1e2 Branch: refs/heads/activemq-5.12.x Commit: 4e32f1e2dbd94945c5e7bbf2f36a8a684ebaac0f Parents: b5663bb Author: Timothy Bish Authored: Wed Sep 2 16:37:13 2015 -0400 Committer: Timothy Bish Committed: Wed Sep 2 16:37:55 2015 -0400 ---------------------------------------------------------------------- .../java/org/apache/activemq/network/jms/DestinationBridge.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/4e32f1e2/activemq-broker/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java b/activemq-broker/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java index 7fc42d1..9595aee 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java +++ b/activemq-broker/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java @@ -82,6 +82,7 @@ public abstract class DestinationBridge implements Service, MessageListener { return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer()); } + @Override public void start() throws Exception { if (started.compareAndSet(false, true)) { createConsumer(); @@ -89,16 +90,18 @@ public abstract class DestinationBridge implements Service, MessageListener { } } + @Override public void stop() throws Exception { started.set(false); } + @Override public void onMessage(Message message) { int attempt = 0; final int maxRetries = jmsConnector.getReconnectionPolicy().getMaxSendRetries(); - while (started.get() && message != null && attempt <= maxRetries) { + while (started.get() && message != null && (maxRetries == ReconnectionPolicy.INFINITE || attempt <= maxRetries)) { try {