Nick Chapsas

The CORRECT way to implement Retries in .NET

https://www.youtube.com/watch?v=nJH0PC2Pubs

  • 05:23 - use Polly for retry logic
  • 05:40 - demo of defining a policy
  • 06:43 - you can define the policy to only fire on specific httpstatus code, for example a 500
  • 07:38 - use RetryAsync for a basic retry attempt (not recommended)
  • 10:08 - exponentially backoff can be problematic if the wait times are high
  • 12:00 - use WaitAndRetryAsync to implement a basic exponentially retry
  • 12:10 - use Polly.Contrib.WaitAndRetry to add a jitter strategy
  • 14:18 - alternatively, you can use Microsoft.Extensions.Http.Polly
      • allows you to globally add Polly on the httpclient instance

Comments

Popular posts from this blog

Angular Routing and Navigation Playbook

Working with Files in C# 10

Mastering Git