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

Issue 151: Fix connection attempts #152

Closed dpasek-senacor closed 2 years ago

dpasek-senacor commented 2 years ago

See: https://github.com/EventStore/EventStoreDB-Client-Java/issues/151

Fixes the retry behavior on connecting to EventStoreDB server, in case the server features could not be retrieved, as server is currently unavailble.

dpasek-senacor commented 2 years ago

I think a better approach would be to decide whether the server features retrieval process is retriable or not. Whatever exception you got when your ESDB server is not ready/up is a valid case for retrying or moving to the next candidate.

Hi @YoEight ! I have adapted the PR to take the type of exception into account on fetching the server features. This will now throw a RetryableException if a retry should be performed otherwise the client is shutdown as before.

I don't know if this is what you meant, but now only a TimeoutException or Status UNAVAIBLE will trigger the retry.