View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |

Plans for Cat.Resilience

Retry and circuit breaker decorators for calls to other services and integrations.
Status: not started. This plan collects what we know. The open questions need an answer before the build.

Contents

The idea

Calls to other services and to external systems fail now and then. A retry fixes a short glitch. A circuit breaker stops hammering something that is down. Decorators can add both to a handler without touching its code.

What we already know

From the root readme:

From the demo plan:

From the Aspire plan:

From the module conventions:

Decisions and open questions

Decided

Topic Decision
Place Decorators on handlers that call other services and integrations.
Independence The module works without Aspire and never references it.
Overlap With Aspire, use ServiceDefaults and skip this module. The module exists for projects without Aspire. It may also hold extensions of ServiceDefaults.
Demo stand-in The payment call in the demo goes to a separate, flaky Cat.Demo.PaymentService, so the module has something to show.

Open

Questions before building

  1. The module is for projects without Aspire. May we depend on Polly for that?
  2. Do you want the decorators on handlers, on HttpClient, or both?
  3. How should a command say it is safe to retry?
  4. Which failures count: exceptions, failed responses, or specific error codes?
  5. How do we prevent retries on retries with the ServiceDefaults handler? Should the module detect it, or do we document it?
  6. Do we need fallbacks and timeouts in the first version?
  7. Where do policies live: attributes, code or appsettings?
  8. Does the module tell Cat.Telemetry about every retry and break?
  9. Does Cat.Api.Client use this module internally, or stay with the HttpClient handler?