Skip to content

rrezartprebreza/spring-boot-skills / skills/spring-boot-3/resilience-retry

resilience-retry

Verified

Use when adding retries, backoff, or concurrency protection to Spring Boot 3 / Spring Framework 6 services. Covers Spring Retry or Resilience4j selection, proxy behavior, and transaction limits.

templates/CatalogRetryService.java

View on GitHub
package com.example.clients;

import java.util.UUID;
import java.util.concurrent.CancellationException;
import org.springframework.context.annotation.Configuration;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.retry.annotation.Retryable;

/** Bounded retry of an idempotent read. Register as a bean and invoke through its proxy. */
public class CatalogRetryService {
    private final CatalogTransport transport;
    public CatalogRetryService(CatalogTransport transport) { this.transport = transport; }

    @Retryable(retryFor = TransientCatalogException.class, maxAttempts = 3,
        backoff = @Backoff(delay = 50, multiplier = 2, maxDelay = 100))
    public String find(UUID id) {
        if (Thread.currentThread().isInterrupted()) throw new CancellationException("Interrupted");
        return transport.fetch(id);
    }

    @FunctionalInterface
    public interface CatalogTransport { String fetch(UUID id); }

    public static class TransientCatalogException extends RuntimeException {
        public TransientCatalogException(Throwable cause) { super("Catalog temporarily unavailable", cause); }
    }

    @Configuration(proxyBeanMethods = false)
    @EnableRetry
    public static class RetryConfiguration {}
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall