msemys / esjc

EventStore Java Client
MIT License
108 stars 27 forks source link

Support info method #55

Open glennvdv opened 5 years ago

glennvdv commented 5 years ago

It would be nice that the evenstore client supports an info method, which returns the /info information from eventstore (version, ...). This way we can use this as HealthIndicator.

msemys commented 4 years ago

es server does not provide such information over tcp (protobuf messages), but es server has Ping command - it could be used to check manually the availability of es server (e.g.: eventstore.ping() - not implement at the moment).

another option to monitor the client (i know it's not the same) is to use client listener, that notifies on connection lost/established:

eventstore.addListener(e -> {
    if (e instanceof ClientConnected) {
        System.out.println("connected");
    } else if (e instanceof ClientDisconnected) {
        System.out.println("disconnected");
    } else if (e instanceof ConnectionClosed) {
        System.out.println("connection closed");
    }
});

eventstore.connect();