ARTEMIS-2424 Add option to override isReachable()
Added check for non default ping command(s) Bypass InetAddress.isReachable() to allow exclusive use of user defined ping command(S).
This commit is contained in:
parent
84c4c2a754
commit
90e4384a41
|
@ -331,7 +331,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (address.isReachable(networkInterface, 0, networkTimeout)) {
|
if (!hasCustomPingCommand() && address.isReachable(networkInterface, 0, networkTimeout)) {
|
||||||
if (logger.isTraceEnabled()) {
|
if (logger.isTraceEnabled()) {
|
||||||
logger.tracef(address + " OK");
|
logger.tracef(address + " OK");
|
||||||
}
|
}
|
||||||
|
@ -415,4 +415,8 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return addresses.isEmpty() && urls.isEmpty();
|
return addresses.isEmpty() && urls.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasCustomPingCommand() {
|
||||||
|
return !getIpv4Command().equals(IPV4_DEFAULT_COMMAND) || !getIpv6Command().equals(IPV6_DEFAULT_COMMAND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue