diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java index b3d3f71fa0..1d02a44df3 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java @@ -331,7 +331,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent { } try { - if (address.isReachable(networkInterface, 0, networkTimeout)) { + if (!hasCustomPingCommand() && address.isReachable(networkInterface, 0, networkTimeout)) { if (logger.isTraceEnabled()) { logger.tracef(address + " OK"); } @@ -415,4 +415,8 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent { public boolean isEmpty() { return addresses.isEmpty() && urls.isEmpty(); } + + public boolean hasCustomPingCommand() { + return !getIpv4Command().equals(IPV4_DEFAULT_COMMAND) || !getIpv6Command().equals(IPV6_DEFAULT_COMMAND); + } }