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

Prioritize reconnect after connection loss in GrpcClient #170

Closed dpasek-senacor closed 1 year ago

dpasek-senacor commented 2 years ago

Currently the GrpcClient implementation triggers an automatic reconnect if an operation fails due to connection loss. This reconnect is queue inside the GrpcClient after all other open work items to be executed. This means, that already queued work items will most probably fail as the reconnect is not performed until all these work items have been executed against the lost server connection.

A simple solution to this problem would be to prioritize the work item for connecting to the server (CreateChannel) over other work items, i.e. always adding it at the beginning of the work item queue instead of the end.

I will provide a PR for this.