Wrapping the circuit breaker with retry

So far, we have learned how circuit breaker and retry patterns can be used and implemented using the Polly framework. The retry pattern is used to retry the request if it fails for a specified amount of time, where circuit breaker keeps the state of the circuit and, based on the threshold of the requests being failed, makes the circuit open and stops calling the remote service for some time, as specified in the configuration to save network bandwidth.

With the Polly framework, we can use the retry and circuit breaker patterns in conjunction and wrap the circuit breaker with the retry pattern to open the circuit if the retry pattern reaches the count of the failed request threshold limit.

In this section, ...

Get C# 7 and .NET Core 2.0 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.