polly-resilience

Compose Polly v8 resilience pipelines for HTTP and non-HTTP .NET operations.

4|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill polly-resilience
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polly-resilience
Source: https://github.com/FaysilAlshareef/dotnet-ai-kit/tree/main/skills/resilience/polly-resilience
Command: npx skills add https://github.com/FaysilAlshareef/dotnet-ai-kit --skill polly-resilience

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many .NET applications fail unpredictably when downstream services are slow, rate-limited, or intermittently unavailable; this Skill provides patterns and guidance to make calls resilient and observable so services degrade gracefully instead of failing catastrophically.

Core Features & Use Cases

  • Standard HTTP Resilience: Apply a sensible default pipeline to HTTP clients to get retry, circuit breaker, and timeout behavior out of the box.
  • Custom and Named Pipelines: Create per-backend pipelines with custom retry strategies, jitter, circuit breaker thresholds, timeouts, fallback logic, hedging, and typed results.
  • Non-HTTP Support: Apply retry and timeout pipelines to database calls, message handling, or other I/O operations via ResiliencePipeline and DI.
  • Use Case: Protect an Orders API client with an exponential-backoff retry plus circuit breaker and a per-attempt timeout, and provide a fallback for degraded responses while emitting telemetry for monitoring.

Quick Start

Add a named HTTP client, apply AddStandardResilienceHandler for defaults, and customize a pipeline with AddResilienceHandler to configure retry, circuit breaker, timeout, and optional fallback strategies.

Frequently Asked Questions about polly-resilience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add retry and circuit breaker behavior to a .NET HTTP client?

You can implement .NET HTTP resilience by adding a standard resilience handler for default retry, circuit breaker, and timeout pipelines, or customize named pipelines with AddResilienceHandler for tailored strategies.

What is the best way to configure Polly v8 resilience pipelines for non-HTTP operations?

The best way to configure Polly v8 resilience pipelines for non-HTTP operations is using ResiliencePipeline with dependency injection to apply retry and timeout strategies to database calls, message handlers, and background I/O operations.

Can I create custom per-backend resilience pipelines with different retry strategies in .NET?

Yes, you can create custom per-backend resilience pipelines using named and typed pipelines to configure distinct exponential-backoff retries, jitter, circuit breaker thresholds, timeouts, fallback logic, and hedging for each backend.

Does Polly v8 support fallback strategies and telemetry for observability?

Polly v8 supports fallback strategies for degraded responses and integrates with telemetry to provide observability, allowing you to monitor resilience pipeline execution and ensure services degrade gracefully under failure conditions.

When should I use hedging in a .NET resilience pipeline?

Use hedging in a .NET resilience pipeline when you need to issue concurrent requests to mitigate downstream service latency or intermittent unavailability, ensuring the application prioritizes the fastest successful response.