You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/04/05 13:25:43 UTC

[1/2] activemq-artemis git commit: [ARTEMIS-1770] Log warning when connection is closed

Repository: activemq-artemis
Updated Branches:
  refs/heads/master eec109947 -> 97ccf96bb


[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/10849eb8
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/10849eb8
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/10849eb8

Branch: refs/heads/master
Commit: 10849eb8abc01b8ae66c9ddeb350625efbc66384
Parents: eec1099
Author: Radovan Stancel <rs...@redhat.com>
Authored: Tue Apr 3 17:09:58 2018 +0200
Committer: Radovan Stancel <rs...@redhat.com>
Committed: Thu Apr 5 08:26:26 2018 +0200

----------------------------------------------------------------------
 .../artemis/core/client/ActiveMQClientLogger.java      |  6 ++++++
 .../artemis/core/client/impl/ClientSessionImpl.java    | 13 ++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/10849eb8/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 8d087a3..4ed2545 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
@@ -555,4 +555,10 @@ public interface ActiveMQClientLogger extends BasicLogger {
    @Message(id = 214033, value = "Cannot resolve host ",
            format = Message.Format.MESSAGE_FORMAT)
    void unableToResolveHost(@Cause UnknownHostException e);
+
+   @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/10849eb8/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 ab9888e..ac21a75 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
@@ -33,7 +33,9 @@ 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.RoutingType;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
@@ -46,7 +48,6 @@ import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
 import org.apache.activemq.artemis.core.client.ActiveMQClientMessageBundle;
 import org.apache.activemq.artemis.core.message.impl.CoreMessageObjectPools;
 import org.apache.activemq.artemis.core.remoting.FailureListener;
-import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.spi.core.remoting.ConsumerContext;
 import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
@@ -1539,6 +1540,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();
             }
@@ -1743,6 +1749,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();


[2/2] activemq-artemis git commit: This closes #1990

Posted by cl...@apache.org.
This closes #1990


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

Branch: refs/heads/master
Commit: 97ccf96bb48c1cf5c00b28c1ba39f7d3df902b4c
Parents: eec1099 10849eb
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Apr 5 09:25:42 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Apr 5 09:25:42 2018 -0400

----------------------------------------------------------------------
 .../artemis/core/client/ActiveMQClientLogger.java      |  6 ++++++
 .../artemis/core/client/impl/ClientSessionImpl.java    | 13 ++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------