activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: [ARTEMIS-1770] Log warning when connection is closed
Date Thu, 05 Apr 2018 17:41:42 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x 360f8425f -> a45d90a8d


[ARTEMIS-1770] Log warning when connection is closed


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

Branch: refs/heads/1.x
Commit: 20aed7f864ad1f2a549a155f2b8e689b8850e7c4
Parents: 360f842
Author: Radovan Stancel <rstancel@redhat.com>
Authored: Tue Apr 3 17:09:58 2018 +0200
Committer: Radovan Stancel <rstancel@redhat.com>
Committed: Thu Apr 5 18:53:05 2018 +0200

----------------------------------------------------------------------
 .../artemis/core/client/ActiveMQClientLogger.java        |  5 +++++
 .../artemis/core/client/impl/ClientSessionImpl.java      | 11 +++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20aed7f8/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
index 88c817f..fbc6959 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java
@@ -442,4 +442,9 @@ public interface ActiveMQClientLogger extends BasicLogger {
    @Message(id = 214029, value = "Unexpected response from HTTP server: %s")
    void unexpectedResponseFromHttpServer(Object response);
 
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 214034, value = "Connection closed: {0} - {1}",
+           format = Message.Format.MESSAGE_FORMAT)
+   void connectionClosedWarn(ActiveMQExceptionType type, String message);
+
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20aed7f8/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
index d5a867d..4596616 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionImpl.java
@@ -31,6 +31,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
 import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
+import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
@@ -1171,6 +1172,11 @@ public final class ClientSessionImpl implements ClientSessionInternal,
FailureLi
             startCall();
             try {
                sessionContext.xaEnd(xid, flags);
+            } catch (ActiveMQNotConnectedException ex) {
+               ActiveMQClientLogger.LOGGER.connectionClosedWarn(ex.getType(), ex.getMessage());
+               if (logger.isDebugEnabled()) {
+                  logger.debug(ex.getMessage(), ex);
+               }
             } finally {
                endCall();
             }
@@ -1375,6 +1381,11 @@ public final class ClientSessionImpl implements ClientSessionInternal,
FailureLi
 
          try {
             sessionContext.xaRollback(xid, wasStarted);
+         } catch (ActiveMQNotConnectedException ex) {
+            ActiveMQClientLogger.LOGGER.connectionClosedWarn(ex.getType(), ex.getMessage());
+            if (logger.isDebugEnabled()) {
+               logger.debug(ex.getMessage(), ex);
+            }
          } finally {
             if (wasStarted) {
                start();


Mime
View raw message