EventStore / EventStoreDB-Client-Java

Official Asynchronous Java 8+ Client Library for EventStoreDB 20.6+
https://eventstore.com
Apache License 2.0
63 stars 20 forks source link

Provide method for preemptively checking if client is still running or has been shutdown #167

Closed dpasek-senacor closed 2 years ago

dpasek-senacor commented 2 years ago

Currently the different client instances like EventStoreDBClient or EventStoreDBProjectionManagementClient will automatically shutdown if they are not able to establish a connection to the Event Store, the download of the server features fails fatally or after a manual shutdown. The client does not support a way for a user of a client instance to determine if the client has been shutdown or is still "up and running". This means, that currently the only way to determine if client instance is checking for a ConnectionShutdownException inside the ExecutionException of the CompletableFuture when executing a command. This is quite cumbersome and cannot be "centralized", i.e. done in a central place to check the healthyness of the client instance.

The API should provide a simple method for checking the status of the client like: public boolen isShutdown() or public boolean isRunning(), isActive() etc.

dpasek-senacor commented 2 years ago

PR: https://github.com/EventStore/EventStoreDB-Client-Java/pull/168