I am trying to implement Retry Policy for Service Bus transient error. I want my system to try exponentially like 1s, 2s, 4s, 8s, 16s, 32s, 64s, 128s.
private int minBackoffDelayInMilliseconds = 2000;
private int maxBackoffDelayInMilliseconds = 10000;
private int deltaBackoffInMilliseconds = 2000;
var defaultPolicy = new RetryPolicy<ServiceBusTransientErrorDetectionStrategy>(new ExponentialBackoff(maxRetries, TimeSpan.FromMilliseconds(minBackoffDelayInMilliseconds), TimeSpan.FromMilliseconds(maxBackoffDelayInMilliseconds), TimeSpan.FromMilliseconds(deltaBackoffInMilliseconds))
Does this look right ? and does this policy affect the system performance ?
Here is a good article from the Azure CAT team that shows a couple of examples.
https://azure.microsoft.com/en-us/documentation/articles/best-practices-retry-service-specific/#service-bus-retry-guidelines
They suggest doing it like this: