activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/3] activemq-artemis git commit: ARTEMIS-153 Improving reconnection log.debug
Date Mon, 06 Jul 2015 20:22:12 GMT
ARTEMIS-153 Improving reconnection log.debug

https://issues.apache.org/jira/browse/ARTEMIS-153

This is bringing some small changes recent made on the legacy implementation


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

Branch: refs/heads/master
Commit: 45ac13008f6466235d6347e6430dfacad7650e0d
Parents: 24979a7
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Mon Jul 6 12:26:39 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Jul 6 14:35:17 2015 -0400

----------------------------------------------------------------------
 .../core/client/ActiveMQClientLogger.java        | 19 +++++++++++++++++++
 .../client/impl/ClientSessionFactoryImpl.java    |  2 ++
 .../core/client/impl/ClientSessionImpl.java      |  6 ------
 .../core/impl/ActiveMQSessionContext.java        |  6 ++----
 4 files changed, 23 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45ac1300/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 0679b66..f1ebde2 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
@@ -418,4 +418,23 @@ public interface ActiveMQClientLogger extends BasicLogger
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 214025, value = "Invalid type {0}, Using default connection factory at {1}",
format = Message.Format.MESSAGE_FORMAT)
    void invalidCFType(String type, String uri);
+
+   @LogMessage(level = Logger.Level.TRACE)
+   @Message(id = 214026,
+      value = "Failure captured on connectionID={0}, performing failover or reconnection
now",
+      format = Message.Format.MESSAGE_FORMAT)
+   void failoverOrReconnect(Object connectionID, @Cause Throwable cause);
+
+   @LogMessage(level = Logger.Level.DEBUG)
+   @Message(id = 214027,
+      value = "Replaying commands for channelID={0} with lastCommandID from the server={1}",
+      format = Message.Format.MESSAGE_FORMAT)
+   void replayingCommands(Object connectionID, int lastConfirmedCommandID);
+
+   @LogMessage(level = Logger.Level.DEBUG)
+   @Message(id = 214028,
+      value = "Couldn't reattach session {0}, performing as a failover operation now and
recreating objects",
+      format = Message.Format.MESSAGE_FORMAT)
+   void reconnectCreatingNewSession(long id);
+
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45ac1300/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
index 88b0a08..a15f9f1 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
@@ -580,6 +580,8 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal,
C
     */
    private void failoverOrReconnect(final Object connectionID, final ActiveMQException me,
String scaleDownTargetNodeID)
    {
+      ActiveMQClientLogger.LOGGER.failoverOrReconnect(connectionID, me);
+
       Set<ClientSessionInternal> sessionsToClose = null;
       if (!clientProtocolManager.isAlive())
          return;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45ac1300/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 36df058..49d8660 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
@@ -975,12 +975,6 @@ public final class ClientSessionImpl implements ClientSessionInternal,
FailureLi
 
             if (!reattached)
             {
-
-               if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
-               {
-                  ActiveMQClientLogger.LOGGER.debug("ClientSession couldn't be reattached,
creating a new session");
-               }
-
                for (ClientConsumerInternal consumer : cloneConsumers())
                {
                   consumer.clearAtFailover();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/45ac1300/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
index 9763043..23370d5 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java
@@ -594,10 +594,7 @@ public class ActiveMQSessionContext extends SessionContext
 
       if (response.isReattached())
       {
-         if (ActiveMQClientLogger.LOGGER.isDebugEnabled())
-         {
-            ActiveMQClientLogger.LOGGER.debug("ClientSession reattached fine, replaying commands");
-         }
+         ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID());
          // The session was found on the server - we reattached transparently ok
 
          sessionChannel.replayCommands(response.getLastConfirmedCommandID());
@@ -606,6 +603,7 @@ public class ActiveMQSessionContext extends SessionContext
       }
       else
       {
+         ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID());
 
          sessionChannel.clearCommands();
 


Mime
View raw message