Hi,
I can’t seem to figure out how to configure the client API for a reconnection scenario.
Whenever I set the connection to reconnect and the EventStore is down the connect operation returns immediately and then first operation just hangs ignoring all timeouts and retries.
With the event store not running
var settings = ConnectionSettings.Create()
.KeepReconnecting()
.SetReconnectionDelayTo(TimeSpan.FromSeconds(5))
.WithConnectionTimeoutOf(TimeSpan.FromSeconds(2))
.SetOperationTimeoutTo(TimeSpan.FromSeconds(2))
.PerformOnAnyNode()
.SetDefaultUserCredentials(creds);
Connection = EventStoreConnection.Create(settings, CommonUtil.Utilities.EndPointParse(config.EventStoreIp, 1113));
Connection.Connect(); //<= returns immediately. As this is the Sync version shouldn’t it block and then timeout?
var evt = Connection.ReadEvent("$users", 0,false); // <=Hangs indefinitely until event store is started
What connection options should I use to get a connection that will fail operations while the eventstore is down but will still try to reconnect?
Note: I have tried all sorts of ways to do this, the only thing that seems close to working is using the defaults, but then it won’t reconnect.
var settings = ConnectionSettings.Create()
.PerformOnAnyNode()
.SetDefaultUserCredentials(creds);
I know I could create a wrapper and handle all of the events, but it seems like the client API is already doing this.
Also is there a way to check the current state of the connection?
Thanks,
Chris