I am trying to implement the policy with DecorrelatedJitterBackoffV2 method:
private static void SetPolicies()
{
var delay = Backoff.DecorrelatedJitterBackoffV2(medianFirstRetryDelay: TimeSpan.FromSeconds(1), retryCount: 5);
_policy = Policy.Handle().WaitAndRetryForeverAsync(retryAttempt => TimeSpan.FromMilliseconds(Math.Pow(2, retryAttempt)),
(exception, timespan, context) =>
{
Log.Information( exception.Message);
});
}
But it has no been possible to include the delay because of the number of attempts. I mean, i need to use the delay generated in the method WaitAndRetryForeverAsync. is it possible?
Thanks in advance.