Setting up a Clustered connection to KeepRetrying


I’m trying to setup a Clustered connection using the ConnectionSettings to keep trying to connect to EventStore when the service has gone down.

When I connect to a single instance, the settings are respected the connection keeps retrying for the specified period.

If I then use this same settings object with the clustered connection, it doesn’t respect the settings.

My example code is:

var settings = ConnectionSettings.Create()





// Attempt to connect to single (unreachable) IP


var singleInstanceConnection = EventStoreConnection.Create(settings, CreateIPEndPoint(1));



// Attempt to connect to (unreachable) cluster of IPs


var clusterSettings = ClusterSettings.Create()




// Connection to cluster appears to ignore settings. Reconnects 10 times then stops.

var clusteredInstanceConnection = EventStoreConnection.Create(settings, clusterSettings);


Am I missing something here?

Thanks in advance…

Is it errors get on discovery attempts as a guess? Not on connection retries?

I believe here is a separate setting for them.

Hi Greg, Thanks for you speedy reply.

There is a method that hangs off the ClusterSettings object called SetMaxDiscoverAttempts which results in the connection attempt being extended from the default of 10 to the specified value and that all works fine…

The problem is, I can’t change the Timeout between retries… it looked like Something the ConnectionSettings should take care of?!

I would like to SetMaxDiscoverAttempts to infinity, with a retry of every miniute (for example)

I should add, that I am on version 3.01



I need to look I think it backs off automatically either way adding support for a timeout here is relatively trivial if not already there.