axum-fault-tolerance
Retries, timeouts, circuit breakers, bulkheads and fallbacks for asynchronous Rust, modelled on MicroProfile Fault Tolerance. Policies are plain Rust values with typed failures, and an optional Tower layer applies them to Axum services.
Availability
Use axum-fault-tolerance from source as a Git or local path dependency. It isn't published on crates.io. Requires Rust 1.85 or later.
Details
It keeps MicroProfile's policy vocabulary but drops the Java
annotations and interceptors. Policies are built with builders and
wrap any async call: handlers, repositories, service clients or queue
consumers. If you'd rather annotate, #[fault_tolerant]
offers the same policies as method attributes. The core doesn't
depend on Axum; the Tower layer is a separate, optional adapter.
Retries take a maximum attempt count, delay, jitter and a cap on total duration. Circuit breakers share state across callers, open on a request-volume threshold and failure ratio, then half-open after a delay. Bulkheads are semaphore-style concurrency limits that reject excess work instead of queuing it. A failure classifier decides, per error, whether to retry, fall back or count against the breaker.
Optional features load policy settings through mp-config and expose circuit-breaker state as an axum-health readiness check.