-
Notifications
You must be signed in to change notification settings - Fork 764
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
Synchronous HttpClient Methods Do Not Use Retry Resiliency Strategy #5236
Comments
OK, so I think I have a repo for this. See repo below. With this registration
This code will NOT invoke the retires when GetRequest() is called, but will invoke the retries when GetRequestAsync() is called:
e.g.
|
Thanks for the report @phil000! @iliar-turdushev could you please take a look here? |
This small console app repo's the issue using both a typed client and named client. |
I am having the same issue. Is there any fix for this? |
@phil000 Thank you for reporting this. We'll add support of resilience strategies for synchronous HttpClient requests. |
The change is available on https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet8 feed. It will be formally released later this month. |
Description
Using Microsoft.Extensions.Http.Resilience 8.6.0
When adding HttpClient to the services container this works, and produces a client that can be retrieved by name, and with the associated resilience pipeline:
However, when using a typed HttpClient the implementation of the interface gets an HttpClient without any resilience pipeline.
e.g. This provides an HttpClient in the implementation class that performs 0 retries:
Reproduction Steps
Use code similar to above to use a typed HttpClient.
Use the HttpClient and observe that no retries are performed.
Expected behavior
Typed HttpClients would be configured with resilience pipeline.
Actual behavior
Typed HttpClients do not appear to be configured with resilience pipeline.
Regression?
No response
Known Workarounds
No response
Configuration
.net 8.0
Other information
Using Microsoft.Extensions.Http.Resilience 8.6.0
The text was updated successfully, but these errors were encountered: