Dodo.HttpClient.ResiliencePolicies 1.0.3

The main goal of this library is to provide unified http request retrying policies for the HttpClient that just works. Actually this library wraps awesome Polly library with the predefined settings to allow developers to use it as is without a deep dive to Polly.

Install-Package Dodo.HttpClient.ResiliencePolicies -Version 1.0.3
dotnet add package Dodo.HttpClient.ResiliencePolicies --version 1.0.3
<PackageReference Include="Dodo.HttpClient.ResiliencePolicies" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dodo.HttpClient.ResiliencePolicies --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Dodo.HttpClient.ResiliencePolicies library

The main goal of this library is to provide unified http request retrying policies for the HttpClient that just works.

Actually this library wraps awesome Polly library with the predefined settings to allow developers to use it as is without a deep dive to Polly.

The DefaultPolicy provided by this library combines RetryPolicy, CircuitBreakerPolicy and TimeoutPolicy under the hood. See the corresponding sections of the README.

Functionality provided by the library

Library provides few methods which returns the IHttpClientBuilder and you may chain it with other HttpMessageHandler.

There are list of public methods to use:

// Default policies for a single host environment using all defaults
IHttpClientBuilder AddDefaultPolicies(this IHttpClientBuilder clientBuilder);

// Default policies for a single host environment with custom settings
IHttpClientBuilder AddDefaultPolicies(this IHttpClientBuilder clientBuilder, HttpClientSettings settings);

// Default policies for a multi host environments using all defaults
IHttpClientBuilder AddDefaultHostSpecificPolicies(this IHttpClientBuilder clientBuilder);

// Default policies for a multi host environments with custom settings
IHttpClientBuilder AddDefaultHostSpecificPolicies(this IHttpClientBuilder clientBuilder, HttpClientSettings settings);

// Default JsonClient includes DefaultPolicies with custom settings
IHttpClientBuilder AddJsonClient<TClientInterface, TClientImplementation>(
    this IServiceCollection sc,
    Uri baseAddress,
    HttpClientSettings settings,
    string clientName = null)
        where TClientInterface : class
        where TClientImplementation : class, TClientInterface

There are also available HttpClientSettings, IRetrySettings and ICircuitBreakerSettings to tune-in the default policies. See the corresponding sections of the README.

Dodo.HttpClient.ResiliencePolicies library

The main goal of this library is to provide unified http request retrying policies for the HttpClient that just works.

Actually this library wraps awesome Polly library with the predefined settings to allow developers to use it as is without a deep dive to Polly.

The DefaultPolicy provided by this library combines RetryPolicy, CircuitBreakerPolicy and TimeoutPolicy under the hood. See the corresponding sections of the README.

Functionality provided by the library

Library provides few methods which returns the IHttpClientBuilder and you may chain it with other HttpMessageHandler.

There are list of public methods to use:

// Default policies for a single host environment using all defaults
IHttpClientBuilder AddDefaultPolicies(this IHttpClientBuilder clientBuilder);

// Default policies for a single host environment with custom settings
IHttpClientBuilder AddDefaultPolicies(this IHttpClientBuilder clientBuilder, HttpClientSettings settings);

// Default policies for a multi host environments using all defaults
IHttpClientBuilder AddDefaultHostSpecificPolicies(this IHttpClientBuilder clientBuilder);

// Default policies for a multi host environments with custom settings
IHttpClientBuilder AddDefaultHostSpecificPolicies(this IHttpClientBuilder clientBuilder, HttpClientSettings settings);

// Default JsonClient includes DefaultPolicies with custom settings
IHttpClientBuilder AddJsonClient<TClientInterface, TClientImplementation>(
    this IServiceCollection sc,
    Uri baseAddress,
    HttpClientSettings settings,
    string clientName = null)
        where TClientInterface : class
        where TClientImplementation : class, TClientInterface

There are also available HttpClientSettings, IRetrySettings and ICircuitBreakerSettings to tune-in the default policies. See the corresponding sections of the README.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 486 10/9/2020
1.0.2 9,033 5/19/2020
1.0.1 149 4/10/2020