I'm trying to implement a retry policy but it keeps getting ignored. Is there properties in SubscriptionClient that overrides the ones I give when I create the client?
Here is the code i tried:
_retryPolicy = new Microsoft.Azure.ServiceBus.RetryExponential(
TimeSpan.FromMinutes(2), // MinBackOff
TimeSpan.FromMinutes(5), // MaxBackOff
3); // Max Retries
_subscriptionClient = new SubscriptionClient(
serviceBusPersisterConnection.ServiceBusConnectionStringBuilder,
subscriptionClientName, retryPolicy: _retryPolicy);
So this should make it only retry 3 times with minimun 2min interval. Result from LOG:
28 May 2019 16:34:49.928 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:49.285 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:48.718 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:48.075 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:47.499 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:46.965 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:46.511 MessageId: 1d327c9033de4fc69892766084264
28 May 2019 16:34:45.957 MessageId: 1d327c9033de4fc69892766084264
As you can see it retried 8 times instead of 3 and the time between retries (this is my main problem) has an interval of half second.
To be sure it was not my retry policies i tried this instead:
_subscriptionClient = new SubscriptionClient(
serviceBusPersisterConnection.ServiceBusConnectionStringBuilder,
subscriptionClientName, retryPolicy: RetryPolicy.NoRetry);
And result was exactly the same, so i'm sure it's being ignored. Any help would be much appreciated.
Keep up the good work.