msemys / esjc

EventStore Java Client
MIT License
108 stars 27 forks source link

eventstore healthcheck #69

Open jselamy opened 3 years ago

jselamy commented 3 years ago

Hi,

Wanted to know what would be the best way to do a healthcheck, in order to check if the connection to the eventstore, using com.github.msemys.esjc.EventStore implementation com.github.msemys.esjc.EventStoreTcp is valid.

I saw there was some sort of com.github.msemys.esjc.EventStoreTcp#connectionState but it's private.

jezovuk commented 3 years ago

There is heartbeat config (interval, timeout) on EventStore connection. Also, it is possible to enable TCP keepalive via TcpSettings. Not exactly a way to inspect connection health directly, but might help.