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-391 log WARN on cxn limit
Date Thu, 18 Feb 2016 16:23:50 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 42b20ebf5 -> d22bed067


ARTEMIS-391 log WARN on cxn limit


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

Branch: refs/heads/master
Commit: e762f823d19fe569e4df6bd0713732223faa5fb4
Parents: 42b20eb
Author: jbertram <jbertram@apache.org>
Authored: Tue Feb 9 13:42:12 2016 -0600
Committer: jbertram <jbertram@apache.org>
Committed: Thu Feb 18 10:19:59 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/remoting/impl/netty/NettyAcceptor.java       | 7 +++----
 .../activemq/artemis/core/server/ActiveMQServerLogger.java    | 4 ++++
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e762f823/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
index a5067c6..8a0dc2f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
@@ -642,10 +642,9 @@ public class NettyAcceptor extends AbstractAcceptor {
             return nc;
          }
          else {
-            if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
-               ActiveMQServerLogger.LOGGER.debug(new StringBuilder().append("Connection limit
of ").append(connectionsAllowed).append(" reached. Refusing connection from ").append(ctx.channel().remoteAddress()));
-            }
-            throw new Exception();
+            ActiveMQServerLogger.LOGGER.connectionLimitReached(connectionsAllowed, ctx.channel().remoteAddress().toString());
+            ctx.channel().close();
+            return null;
          }
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e762f823/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
index f7038fb..aca3c3f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
@@ -1204,6 +1204,10 @@ public interface ActiveMQServerLogger extends BasicLogger {
    @Message(id = 222205, value = "OutOfMemoryError possible! There are currently {0} addresses
with a total max-size-bytes of {1} bytes, but the maximum memory available is {2} bytes.",
format = Message.Format.MESSAGE_FORMAT)
    void potentialOOME(long addressCount, long totalMaxSizeBytes, long maxMemory);
 
+   @LogMessage(level = Logger.Level.WARN)
+   @Message(id = 222206, value = "Connection limit of {0} reached. Refusing connection from
{1}.", format = Message.Format.MESSAGE_FORMAT)
+   void connectionLimitReached(long connectionsAllowed, String address);
+
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
    void initializationError(@Cause Throwable e);


Mime
View raw message