You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
OK, so I think I have a repo for this.
It doesn't relate to the client being typed, but seem to relate to the fact our ConfigurationServiceClient uses synchronous methods on HttpClient.
phil000
changed the title
AddResilienceHandler Does Not Work with Typed HttpClient
Synchronous HttpClient Methods Do Not Use Retry Resiliency Strategy
Jun 19, 2024
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: