Hi Clebert,

the idea looks ok. 

Maybe it could be more system agnostic. I think that ping command might not be 
present on some OS installations. InetAddress#isReachable(int) works in best 
effort mode based on [1] and need some privileges. Do you think it could be 
possible to provide some default implementation and allow user to add his own 
kind of check of IP addresses.

Also this should support IPv6 addresses. wdyt?

Thanks,
Mirek

[1] 
https://docs.oracle.com/javase/8/docs/api/java/net/InetAddress.html#isReachable-int-

----- Original Message -----
> From: "Clebert Suconic" <[email protected]>
> To: [email protected]
> Sent: Tuesday, November 22, 2016 2:17:19 AM
> Subject: [DISCUSS] ARTEMIS-863 - Network Health Check
> 
> I am implementing a feature that will allow an user to specify a ping
> address list.
> 
> 
> the broker will ping such list on a given interval, and it will
> shutdown once the list cannot be achieved.
> 
> 
> For instance, you specify 10.0.0.1, the broker will ping 10.0.0.1
> every 10 seconds, and if that address is not reachable, it would go
> down. (shutdown). this is to prevent a network isolation, so in case
> you pull out the cable of the server the server will shutdown until
> the network is back.
> 
> 
> 
> There are 4 properties currently implemented:
> 
> 
> <network-check-list> - IPs to be pinged (or DNS) .. this is simple
> ICMP through Network.isReachable
> 
> <network-check-NIC> - The network Interface Card name
> 
> <network-check-period>  - The interval in MS
> 
> <network-check-timeout> - The timeout to fail the ping in Milliseconds
> 
> <network-check-URL-list> - Similar to checkList, but this will use
> HTTP open in a similar fashion.
> 
> 
> 
> These will work nicely by setting System properties. (which I will
> further improve by allowing something like ./artemis run
> -Cnetwork-check-list=10.0.0.2)
> 
> 
> I have already implemented this into a branch which I will send tomorrow as
> PR.
> 
> https://github.com/clebertsuconic/activemq-artemis/commits/netcheck
> 
> (BTW this link will not be valid for future readers of the list.. on
> that case... just look at the commits on master and look for
> ARTEMIS-863 on the git logs).
> 
> 
> 
> 
> 
> --
> Clebert Suconic
> 

Reply via email to