How to Implementation Circuit breaker design pattern in dot net core
Loading
How to Implementation Circuit breaker design pattern in dot net core
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaimin ShethiyaPosted Aug 19, 2023, 2:58 PM
Hello S A,
You install the Polly Package and implement the circuit breaker pattern.
You can refer to the below links.
https://codingcanvas.com/implementing-retry-and-circuit-breaker-pattern-using-polly/
https://www.twilio.com/blog/using-polly-circuit-breakers-resilient-net-web-service-consumers
Tahir AnsariPosted Aug 17, 2023, 4:40 PM
// Startup.cs
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddScoped();
services.AddSingleton();
services.AddScoped();
// ...
}
Cr BhargaviPosted Aug 17, 2023, 3:25 PM
In your application's startup or configuration, set up a Circuit Breaker policy using Polly. You can do this by creating a custom policy with specified failure thresholds and time durations.
Example: