Rebus Retry backoff and Polly support

by Pingpong   Last Updated May 16, 2019 00:26 AM

I have questions on Backoff policy below:

1 Can it be used for both Publiser (enqueue messages) and Subscriber (dequeue messages)?

2 Is Rebus Backoff policy same as Polly's Retry? But the description below mentions idle time, which I am a bit confused.

   //
    // Summary:
    //     Configures the timespans to wait when backing off polling the transport during
    //     idle times. backoffTimes must be a sequence of timespans, which indicates the
    //     time to wait for each second elapsed being idle. When the idle time exceeds the
    //     number of timespans, the last timespan will be used.
    public static void SetBackoffTimes(this OptionsConfigurer configurer, params TimeSpan[] backoffTimes);



Configure.With(...)
    .(...)
    .Options(o => {
        o.SetBackoffTimes(
            TimeSpan.FromMilliseconds(100),
            TimeSpan.FromMilliseconds(200),
            TimeSpan.FromSeconds(1)
        );
    })
            .Start();

3 Does Rebus support Polly extension? For example, exponential back-off plus some jitter like at the bottom

Random jitterer = new Random(); 
Policy
  .Handle<HttpResponseException>() // etc
  .WaitAndRetry(5,    // exponential back-off plus some jitter
      retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))  
                    + TimeSpan.FromMilliseconds(jitterer.Next(0, 100)) 
  );

https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly

4 I cannot find ISyncBackoffStrategy on the latest Rebus nutget. Is it deprecated?

 Configure.With(...)
        .(...)
        .Options(o => {
            o.Register<ISyncBackoffStrategy>(c => {
                var strategy = new MyOwnBackoffStrategy();
                return strategy;
            });
        })
        .Start();

https://github.com/rebus-org/Rebus/wiki/Back-off-strategy



Related Questions


Updated February 12, 2019 02:26 AM

Updated August 28, 2018 12:26 PM

Updated January 26, 2018 16:26 PM

Updated March 29, 2019 08:26 AM

Updated June 13, 2017 11:26 AM