Skip to content

Latest commit

 

History

History

Bet.AspNetCore.Hosting.Resilience

Bet.AspNetCore.Hosting.Resilience

GitHub license Build status NuGet Nuget feedz.io

The second letter in the Hebrew alphabet is the ב bet/beit. Its meaning is "house". In the ancient pictographic Hebrew it was a symbol resembling a tent on a landscape.

Note: Pre-release packages are distributed via feedz.io.

Summary

This Library provides registration for hosting container of IHost interface for HttpClient message handlers.

buymeacoffee

Give a Star! ⭐

If you like or are using this project to learn or start your solution, please give it a star. Thanks!

Install

    dotnet add package Bet.AspNetCore.Hosting.Resilience

Usage

Add the following in Program.cs

 public static IHostBuilder CreateHostBuilder(string[] args)
{
    return Host
        .CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.UseResilienceOnStartup();

            webBuilder.UseStartup<Startup>();
        });
}

appsettings.json

  "DefaultHttpPolicies": {

    "HttpTimeoutPolicy": {
      "Timeout": "00:01:40" // Timeout for an individual try
    },

    "HttpCircuitBreakerPolicy": {
      "DurationOfBreak": "00:00:10",
      "ExceptionsAllowedBeforeBreaking": 2
    },

    "HttpRetryPolicy": {
      "BackoffPower": 2,
      "Count": 3
    }

  }