Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Bryan Hogan
    Using Polly Circuit Breakers for Resilient .NET Web Service Consumers Using Polly Circuit Breakers header image

    If you have a bit of familiarity with Polly, the resilience framework for .NET, you will know how useful the Retry and Wait and Retry policies are for handling transient faults and longer outages. But there are times when no amount of retries will solve the problem, the remote system is unresponsive, has been for a while and will likely continue to be so. In this scenario, cutting the connection to the failing system might be the best approach.

    Polly lets you do this with its Circuit Breaker policies. The policies get their name from the circuit breaker in your home that cuts electricity to an outlet or fixture. Just like the real-world circuit breaker, the Polly Circuit Breakers cut your connection to a faulting system.

    This post shows you how to incorporate Polly Circuit Breakers into your resilience strategy. You’ll build working examples with ASP.NET Core 2.1 and see …

    Read More
  • By Bryan Hogan
    Polly Fallbacks: The Last Line of Defense in .NET Service-to-Service Communication Polly Fallbacks for Building Resilient .NET Service-to-Service Communication

    Using Polly, the resilience framework for .NET, you can gracefully handle lost packets, thrown exceptions, and failed requests which inevitably make their way into service-to-service communications on the web. Polly provides resilience strategies for your apps through policies such as Retry, WaitAndRetry, and CircuitBreaker, enabling you to implement fault tolerance in your distributed systems in a fluent fashion.

    This post will introduce you to the Fallback policy and demonstrate its use in a straightforward ASP.NET Core 2.1 example. It will guide you in using the Fallback policy to handle failures you cannot recover from: when all else fails, fallback to this last line of defense.

    If you’re not already familiar with Polly, the first post in this series on the Twilio blog introduced Polly, the .NET resilience framework. The second post build on the first and introduced the HttpClientFactory.


    To follow along with this post you need: …

    Read More
  • By Bryan Hogan
    More Resilient Service-to-Service Communication with Polly and .NET HttpClientFactory more-resilient-service-to-service-to-service-communication-polly-dotnet.png

    Using Polly, the resilience framework for .NET, you can gracefully handle the lost packets, thrown exceptions, and failed requests which inevitably make their way into service-to-service communications on the web. A previous post on the Twilio blog introduced Polly, the .NET resilience framework. This post builds on that knowledge to strengthen your application's interaction with API endpoints.

    The original .NET HttpClient was a convenient way to send and receive HTTP requests and responses on the web, but unless HttpClient was carefully implemented its use could result in socket exhaustion. The release of .NET Core 2.1 introduced HttpClientFactory, which can be instantiated once and used throughout the life of an application.

    This post will show you how to combine HttpClientFactory with Polly to achieve efficient and resilient service-to-service communications. You'll see how you can do it more reliably, conveniently, and with less code than using HttpClient.


    To …

    Read More
  • By Bryan Hogan
    Building Resilient Service-to-Service Communications in ASP.NET Core with Polly, the .NET Resilience Framework rwNecMwoSUez0Ube7w9hsk4xKt_AVXOmIPDyu8qHhgvjZZUDl2t5hQyMp0YIclb6XpIdKdRSFRVnhg0Tf78mV7SmPFSWHGpkGMUzF68JTo2D40YC1VlT-auZj3qg-5Ub40shcDCu

    Service-to-service communication is becoming more and more common, but we know the network has never been reliable and that other people's code has bugs. Packets are lost, exceptions are thrown, and requests fail; it will happen to your application—to all applications!
    Using the Polly Resilience Framework you can easily retry a failed request, no messy for loops or try catches needed. Just a few lines of code and your applications will never be the same!

    This post shows how to make reliable requests to an unreliable "remote" service with almost no overhead.

    You’ll start with a “remote” Web API application that returns errors 75% of the time. Then you’ll build a “local“ Web API application that calls the remote one (of course receiving errors three quarters of the time).

    Finally, you will add Polly to the “local” application to perform retires on failed requests. With a few minutes work you …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.