From 842ac1df5d95e6db5faf0cca105d8f9dbf545df0 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Fri, 18 Mar 2022 14:28:39 -0500 Subject: [PATCH] ARTEMIS-3676 ignore NoRouteToHostException This kind of exception can be common in cloud environments and should be ignored for logging just like ConnectException. --- .../artemis/core/remoting/impl/netty/NettyConnector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java index 05ed85d2db..0514411fb5 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.net.ConnectException; import java.net.InetAddress; import java.net.InetSocketAddress; +import java.net.NoRouteToHostException; import java.net.SocketAddress; import java.net.URI; import java.net.URISyntaxException; @@ -951,7 +952,7 @@ public class NettyConnector extends AbstractConnector { } else { Throwable t = future.cause(); - if (t != null && !(t instanceof ConnectException)) { + if (t != null && !(t instanceof ConnectException) && !(t instanceof NoRouteToHostException)) { ActiveMQClientLogger.LOGGER.errorCreatingNettyConnection(future.cause()); }