ARTEMIS-391 log WARN on cxn limit

This commit is contained in:
jbertram 2016-02-09 13:42:12 -06:00
parent 42b20ebf51
commit e762f823d1
2 changed files with 7 additions and 4 deletions

View File

@ -642,10 +642,9 @@ public class NettyAcceptor extends AbstractAcceptor {
return nc; return nc;
} }
else { else {
if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) { ActiveMQServerLogger.LOGGER.connectionLimitReached(connectionsAllowed, ctx.channel().remoteAddress().toString());
ActiveMQServerLogger.LOGGER.debug(new StringBuilder().append("Connection limit of ").append(connectionsAllowed).append(" reached. Refusing connection from ").append(ctx.channel().remoteAddress())); ctx.channel().close();
} return null;
throw new Exception();
} }
} }
} }

View File

@ -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) @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); 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) @LogMessage(level = Logger.Level.ERROR)
@Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT) @Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
void initializationError(@Cause Throwable e); void initializationError(@Cause Throwable e);