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
/// <item><description>Total request timeout strategy applies an overall timeout to the execution,
23
23
/// ensuring that the request including hedging attempts does not exceed the configured limit.</description></item>
24
24
/// <item><description>The hedging strategy executes the requests against multiple endpoints in case the dependency is slow or returns a transient error.</description></item>
25
-
/// <item><description>The bulkhead policy limits the maximum number of concurrent requests being send to the dependency.</description></item>
25
+
/// <item><description>The rate limiter pipeline limits the maximum number of requests being send to the dependency.</description></item>
26
26
/// <item><description>The circuit breaker blocks the execution if too many direct failures or timeouts are detected.</description></item>
27
27
/// <item><description>The attempt timeout strategy limits each request attempt duration and throws if its exceeded.</description></item>
Copy file name to clipboardExpand all lines: src/Libraries/Microsoft.Extensions.Http.Resilience/README.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Microsoft.Extensions.Http.Resilience
2
2
3
-
Resilience mechanisms for HTTP Client.
3
+
Resilience mechanisms for `HttpClient` built on the [Polly framework](https://www.pollydocs.org/).
4
4
5
5
## Install the package
6
6
@@ -18,6 +18,60 @@ Or directly in the C# project file:
18
18
</ItemGroup>
19
19
```
20
20
21
+
## Usage Examples
22
+
23
+
When configuring an HttpClient through the [HTTP client factory](https://learn.microsoft.com/dotnet/core/extensions/httpclient-factory) the following extensions can add a set of pre-configured hedging or resilience behaviors. These pipelines combine multiple resilience strategies with pre-configured defaults.
24
+
- The total request timeout pipeline applies an overall timeout to the execution, ensuring that the request including hedging attempts, does not exceed the configured limit.
25
+
- The retry pipeline retries the request in case the dependency is slow or returns a transient error.
26
+
- The rate limiter pipeline limits the maximum number of requests being send to the dependency.
27
+
- The circuit breaker blocks the execution if too many direct failures or timeouts are detected.
28
+
- The attempt timeout pipeline limits each request attempt duration and throws if its exceeded.
29
+
30
+
### Resilience
31
+
32
+
The standard resilience pipeline makes use of the above strategies to ensure HTTP requests can be sent reliably.
The standard hedging pipeline uses a pool of circuit breakers to ensure that unhealthy endpoints are not hedged against. By default, the selection from pool is based on the URL Authority (scheme + host + port). It is recommended that you configure the way the strategies are selected by calling the `SelectPipelineByAuthority()` extensions. The last three strategies are applied to each individual endpoint.
0 commit comments