You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/09/02 22:38:02 UTC

activemq git commit: AMQ-5949 Treat maxSendRetries of -1 as infinite. (cherry picked from commit 505916b92797035c6c41174f220d9e9c9f669b79)

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 <ta...@gmail.com>
Authored: Wed Sep 2 16:37:13 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
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 {