-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: Expose Resilience HTTP Message Handler #4759
Comments
Thanks for logging the proposal @kmcclellan 😃 Tagging @martintmk and @geeknoid so that they can have a closer look at the proposal. |
@joperezr LGTM I was even thinking about exposing it too, but decided until there is a real use-case for this. |
Please consider exposing |
Here's a use case I believe from the official docs: https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines#resilience-policies-with-static-clients. Currently attempting to follow that guidance using resilient pipelines but not having any luck so far. |
Fixes #4759 Co-authored-by: Martin Taillefer <[email protected]>
Co-authored-by: Martin Taillefer <[email protected]> Co-authored-by: martintmk <[email protected]> Co-authored-by: Nikita Balabaev <[email protected]> Co-authored-by: Martin Taillefer <[email protected]> Fixes #4759
Background and motivation
I'm attempting to migrate from
Microsoft.Extensions.Http.Polly
toMicrosoft.Extensions.Http.Resilience
(see dotnet/docs#40841).However, in my code base there are some scenarios where I want to bypass
IHttpClientBuilder
and instantiate an HTTP delegating message handler directly. The former library exposes a publicPolicyHttpMessageHandler
for this purpose. Can we consider exposing this library's handler?To motivate, I'll illustrate two reasons I have found for bypassing the builder.
AddResilienceHandler
is called more than once.These can both be accomplished with a custom implementation of
IConfigureNamedOptions<HttpClientFactoryOptions>
:API Proposal
API Usage
Alternative Designs
No response
Risks
Future changes to the handler's public constructors are more likely to be breaking.
The text was updated successfully, but these errors were encountered: