You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2018/07/05 16:36:09 UTC

activemq git commit: AMQ-4706 - ensure we log the first warn and include the failure reason

Repository: activemq
Updated Branches:
  refs/heads/master d8c939a4b -> 2b64b7b04


AMQ-4706 - ensure we log the first warn and include the failure reason


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/2b64b7b0
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/2b64b7b0
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/2b64b7b0

Branch: refs/heads/master
Commit: 2b64b7b04fb22600390f0eea56d1386f934a5368
Parents: d8c939a
Author: gtully <ga...@gmail.com>
Authored: Thu Jul 5 17:34:30 2018 +0100
Committer: gtully <ga...@gmail.com>
Committed: Thu Jul 5 17:34:30 2018 +0100

----------------------------------------------------------------------
 .../apache/activemq/transport/failover/FailoverTransport.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/2b64b7b0/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
index 655f143..9c24828 100644
--- a/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
@@ -1096,9 +1096,9 @@ public class FailoverTransport implements CompositeTransport {
             }
 
             int warnInterval = getWarnAfterReconnectAttempts();
-            if (warnInterval > 0 && (connectFailures % warnInterval) == 0) {
-                LOG.warn("Failed to connect to {} after: {} attempt(s) continuing to retry.",
-                         uris, connectFailures);
+            if (warnInterval > 0 && (connectFailures == 1 || (connectFailures % warnInterval) == 0)) {
+                LOG.warn("Failed to connect to {} after: {} attempt(s) with {}, continuing to retry.",
+                         uris, connectFailures, (failure == null ? "?" : failure.getLocalizedMessage()));
             }
         }