An open API service indexing awesome lists of open source software.

https://github.com/danielmackay/dotnet-api-retry


https://github.com/danielmackay/dotnet-api-retry

api-rest dotnet-6 polly

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# .NET API Retry

[![.NET](https://github.com/danielmackay/dotnet-api-retry/actions/workflows/dotnet.yml/badge.svg)](https://github.com/danielmackay/dotnet-api-retry/actions/workflows/dotnet.yml)
[![Licence](https://img.shields.io/badge/licence-MIT-brightgreen)](https://github.com/danielmackay/dotnet-api-retry/blob/main/licence.md)
[![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev)

> Based off of Nick Chapsas's Youtube [video](https://youtu.be/nJH0PC2Pubs)

## 💡 Overview

Simple Web API that returns Star Wars People from an external API. `IHttpClientFactory` and `Polly` have been used to implement a transient retry policy.

The policy works as follows:

- Triggered via
- `HttpRequestException` being thrown
- HTTP 5XX being returned
- Http 408 (request timeout) being returned
- Retries
- Retry 5 times
- Exponential backoff with jitter between retries

## ⚡ Getting Started

- `dotnet run` or `dotnet watch run`
- Browser will launch and navigate to

## 📖 References

- [Starwars API](https://swapi.dev/)