0

It seems that .NET Standard Azure ServiceBus client library doesn't have exposed possibility to set DeltaBackoff parameter. It was possible before, based on documentation it should be still possible. I see there is an internal constructor which is chained to the public one and value for DeltaBackoff is passed from Constants.DefaultRetryDeltaBackoff (3 seconds).

Is there a valid reason to not expose that anymore? Also, is there a way to achieve exponential retries using SubscriptionClient with 2/4/8 minutes delay without setting DeltaBackoff?

Darjan Bogdan
  • 3,780
  • 1
  • 22
  • 31

1 Answers1

0

Couldn't find the other way than using reflection to instantiate RetryExponential via its internal constructor:

var internalCtor = typeof(RetryExponential)
    .GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)
    .Single();

var instance = (RetryExponential)internalCtor.Invoke(
    new object[] { TimeSpan.FromMinutes(2), TimeSpan.FromMinutes(8), TimeSpan.FromMinutes(2), 3 }
    );

Console.WriteLine(instance.DeltaBackoff); // 00:02:00

Here is the issue on the repository, if someone wants to track it.

Darjan Bogdan
  • 3,780
  • 1
  • 22
  • 31