resilience
تایید شدهKnowledge Pack: Resilience -- Circuit breaker, rate limiting, bulkhead isolation, timeout control, retry with exponential backoff, fallback, graceful degradation, backpressure, and resilience metrics for my-java-cli.
(0)
۰
۲
۳
نصب مهارت
مهارتها کدهای شخص ثالث از مخازن عمومی GitHub هستند. SkillHub الگوهای مخرب شناختهشده را اسکن میکند اما نمیتواند امنیت را تضمین کند. قبل از نصب، کد منبع را بررسی کنید.
نصب سراسری (سطح کاربر):
npx skillhub install edercnj/ia-dev-environment/resilienceنصب در پروژه فعلی:
npx skillhub install edercnj/ia-dev-environment/resilience --projectمسیر پیشنهادی: ~/.claude/skills/resilience/
محتوای SKILL.md
---
name: resilience
description: >
Knowledge Pack: Resilience -- Circuit breaker, rate limiting, bulkhead
isolation, timeout control, retry with exponential backoff, fallback,
graceful degradation, backpressure, and resilience metrics for my-java-cli.
---
# Knowledge Pack: Resilience
## Summary
Resilience patterns for my-java-cli using java 21 with picocli.
### Circuit Breaker
- States: CLOSED (normal) → OPEN (failing) → HALF-OPEN (probing)
- Track failure rate over a sliding window
- Open circuit on threshold breach, redirect to fallback
- Half-open: allow limited probe requests to test recovery
### Retry with Backoff
- Exponential backoff with jitter to prevent thundering herd
- Max retries: 3 (configurable per operation)
- Retry only on transient errors (network, 503, timeout)
- Never retry non-idempotent operations without explicit design
### Additional Patterns
- **Bulkhead**: Limit concurrent calls per dependency, isolate failure domains
- **Timeout**: Set timeouts on every external call, propagate deadlines across boundaries
- **Rate Limiting**: Token bucket or sliding window, return HTTP 429 with `Retry-After`
- **Backpressure**: Bounded queues with rejection policy, flow control in consumers
## References
- [Release It! — Michael Nygard](https://pragprog.com/titles/mnee2/release-it-second-edition/) -- Stability patterns: circuit breaker, bulkhead, timeout
- [Microsoft Cloud Design Patterns](https://learn.microsoft.com/en-us/azure/architecture/patterns/) -- Retry, circuit breaker, throttling, and bulkhead patterns
- [Google SRE Book — Handling Overload](https://sre.google/sre-book/handling-overload/) -- Load shedding, backpressure, and graceful degradation