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 8a0dc2feb6..efbc1ea33a 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 @@ -426,6 +426,9 @@ public class NettyAcceptor extends AbstractAcceptor { * @param channel A Netty channel created outside this NettyAcceptor. */ public void transfer(Channel channel) { + if (paused || eventLoopGroup == null) { + throw ActiveMQMessageBundle.BUNDLE.acceptorUnavailable(); + } channel.pipeline().addLast(protocolHandler.getProtocolDecoder()); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java index a46d240acf..da1aee44aa 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java @@ -365,4 +365,7 @@ public interface ActiveMQMessageBundle { @Message(id = 119115, value = "Colocated Policy hasn't different type live and backup", format = Message.Format.MESSAGE_FORMAT) ActiveMQIllegalStateException liveBackupMismatch(); + + @Message(id = 119116, value = "Netty Acceptor unavailable", format = Message.Format.MESSAGE_FORMAT) + IllegalStateException acceptorUnavailable(); }