.Net SDK 1.5.1 How do you set a custom retry strategy in options.RetryStrategy()?

Hi,

How do you set your own custom retry strategy with IRetryStrategy?

Newing up RetryStrategy() I get error:

The type or namespace name ‘RetryStrategy’ could not be found (are you missing a using directive or an assembly reference?

Then when I add in:
using Couchbase.Core.IO.Operations.Errors;

I get error can’t convert between

using Couchbase.Core.Retry
and
Couchbase.Core.IO.Operations.Errors

I just want to retry 3 times, with ExponentialBack off.

Thanks,

Brian Davis

@Brian_Davis -

It should just be a matter of implementing the Couchbase.Core.Retry.IRetryStrategy interface and providing your own implementation. After that, you pass it as a reference to GetOptions.RetryStrategy(IRetryStrategy retryStrategy).

This is the wrong namespace for IRetryStrategy - it should be:

using Couchbase.Core.Retry;
...

-Jeff

1 Like