Registry / utility / guava-retrying

guava-retrying

JSON →
library2.0.0javamavenunverified

A small extension to Google's Guava library for creating configurable retrying strategies for arbitrary function calls.

<dependency> <groupId>com.github.rholder</groupId> <artifactId>guava-retrying</artifactId> <version>2.0.0</version> </dependency>
INSTALL
IMPORT
SIG · GUAVA-RETRYING
G
guava-retrying
utilityjavav2.0.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.

RetryerBuilder
com.github.rholder.retry.RetryerBuilder

Creates a retryer that retries on exception with a fixed wait time.

import com.github.rholder.retry.RetryerBuilder; import com.github.rholder.retry.StopStrategies; import com.github.rholder.retry.WaitStrategies; import java.util.concurrent.Callable; Callable<Boolean> callable = () -> { /* your flaky code */ return true; }; Boolean result = RetryerBuilder.<Boolean>newBuilder() .retryIfException() .withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS)) .withStopStrategy(StopStrategies.stopAfterAttempt(3)) .build() .call(callable);
Debug
Known issues
gotchaGuava Retrying is not actively maintained and may have compatibility issues with newer Guava versions.
fix
Consider using resilience4j-retry or Spring Retry as alternatives.
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
guava-retrying — mvn dependency:get guava-retrying · libregistry