Platform Resilience & Fallback Handling Skill
Purpose
Standardize fault tolerance, circuit breaking, retry policies, and ambiguous failure modeling across external payment gateways and integrations.
1. Rules of Engagement
MANDATORY
- MUTATING RETRY SAFETY RULE: Never blindly retry a financially mutating external operation (e.g. payment initiation, charge, refund).
- Apply
@RetryONLY when:- The downstream endpoint explicitly guarantees idempotency support, OR
- The operation is strictly read-only / idempotent by HTTP semantics.
- Apply
- FAILURE TRIAGE MODEL: Financial integrations MUST explicitly distinguish between three outcome states:
- Business Failure: Downstream explicitly rejected payment (e.g.
INSUFFICIENT_FUNDS,CARD_EXPIRED). Status ->FAILED. - Technical Failure: Integration call failed before execution (e.g. DNS failure, HTTP 400). Status ->
REJECTED. - Unknown Outcome: Request timed out after transmission (e.g. HTTP 504 Gateway Timeout). Status ->
PENDING_VERIFICATION/UNKNOWN. (Do NOT immediately fail or retry!)
- Business Failure: Downstream explicitly rejected payment (e.g.
2. Circuit Breaker Configuration Pattern
resilience4j.circuitbreaker:
instances:
gatewayService:
slidingWindowSize: 20
minimumNumberOfCalls: 5
failureRateThreshold: 50
waitDurationInOpenState: 10000ms