Registry / utility / resilience4j-retry

resilience4j-retry

JSON →
library2.4.0javamavenunverified

A lightweight fault tolerance library providing retry mechanisms for Java 8 and functional programming.

<dependency> <groupId>io.github.resilience4j</groupId> <artifactId>resilience4j-retry</artifactId> <version>2.4.0</version> </dependency>
INSTALL
IMPORT
SIG · RESILIENCE4J-RETRY
R
resilience4j-retry
utilityjavav2.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Retry
✓ io.github.resilience4j.retry.Retry

Configures a retry with 3 attempts and 500ms wait, then decorates a supplier.

import io.github.resilience4j.retry.Retry; import io.github.resilience4j.retry.RetryConfig; import java.time.Duration; import java.util.function.Supplier; public class Example { public static void main(String[] args) { RetryConfig config = RetryConfig.custom().maxAttempts(3).waitDuration(Duration.ofMillis(500)).build(); Retry retry = Retry.of("myRetry", config); Supplier<String> decorated = Retry.decorateSupplier(retry, () -> { if (Math.random() > 0.5) throw new RuntimeException("fail"); return "success"; }); System.out.println(decorated.get()); } }
Debug
Known issues
gotchaRetry decorators may throw exceptions after exhausting attempts; handle them appropriately.
fix
Wrap decorated calls in try-catch or use fallback methods.
affects: all
Upgrade
Version history
2.4.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
resilience4j-retry — mvn dependency:get resilience4j-retry · libregistry