spring-retry

Configure declarative and imperative retries for Spring applications.

1|Updated May 9, 2026
One-click install
npx skills add https://github.com/lvoxx/simple-shorten-url --skill spring-retry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-retry
Source: https://github.com/lvoxx/simple-shorten-url/tree/main/.claude/skills/spring-retry
Command: npx skills add https://github.com/lvoxx/simple-shorten-url --skill spring-retry

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires spring-retry, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies error handling in Spring applications by managing retries for failed operations declaratively or imperatively.

Core Features & Use Cases

  • Declarative Retry: Use @Retryable annotations to automatically retry methods when exceptions occur.
  • Imperative Retry: Employ RetryTemplate for explicit retry control over operations.
  • Backoff Policies: Apply fixed, exponential, or random backoff strategies between retries.
  • Circuit Breaker: Implement the circuit breaker pattern to handle service failures and prevent cascading failures.
  • Recovery Methods: Specify fallback methods to recover from failed operations.
  • Metrics Integration: Integrate with Micrometer for monitoring retry behavior.
  • Use Case: A service that periodically checks for updates may benefit from retry logic to handle transient network issues.

Quick Start

Annotate a method with @Retryable to retry on failures: java @Retryable(RetryFor = RemoteAccessException.class) public void fetch() { ... }

Frequently Asked Questions about spring-retry

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

FAQPage Schema
How do I add retry logic to Spring methods handling transient failures?

Retry failed operations in Spring by annotating methods with `@Retryable` or explicitly controlling execution with `RetryTemplate`, applying configurable retry policies and backoff strategies for transient failures.

What backoff strategies can I configure for Spring application retries?

Spring retry backoff strategies include fixed, exponential, and random waits between retries, configurable declaratively or imperatively to manage service resilience and prevent cascading failures during transient network issues.

How does the circuit breaker pattern work with Spring retry mechanisms?

The circuit breaker pattern integrates with Spring retry to handle service failures by stopping retry attempts when a threshold is reached, preventing cascading failures and allowing the failing service time to recover.

Can I specify a fallback recovery method when Spring retries are exhausted?

Yes, Spring retry allows you to specify recovery methods as fallbacks, which execute automatically when a `@Retryable` operation exhausts all configured retry attempts and fails.

Should I use declarative or imperative retry strategies in Spring?

Use declarative `@Retryable` annotations for automatic retry on simple method executions, or choose imperative `RetryTemplate` when explicit, programmatic control over retry operations and policies is required.

How do I monitor Spring retry behavior and metrics?

Monitor Spring retry behavior by integrating with Micrometer, which provides observable metrics for retry attempts, failures, and backoff strategies to track service resilience over time.