Skip to content

A Java library to allow for the creation of configurable retrying strategies for an arbitrary function call, such as something that communicates with a remote service.

License

Notifications You must be signed in to change notification settings

arakelian/retry

Repository files navigation

Retry

version CI

The retry module provides a general purpose method for retrying arbitrary Java code with specific stop, retry, and exception handling capabilities that are enhanced by Guava's predicate matching.

This is a fork of the guava-retrying library by Ryan Holder (rholder), which is itself a fork of the RetryerBuilder by Jean-Baptiste Nizet (JB). The retry project added a Gradle build for pushing it up to Maven Central, and exponential and Fibonacci backoff WaitStrategies that might be useful for situations where more well-behaved service polling is preferred.

Reasons for Fork

  • Add Java 11 support
  • Use java.util.Predicate and java.util.Function instead of Guava equivalents
  • Make compatible with latest versions of Guava
  • Fix all errorprone warnings in original source code

Requirements

  • Versions < 6.0.0 require Java 8+
  • Version 6+ require Java 11+

Installation

The library is available on Maven Central.

Maven

Add the following to your pom.xml:

<repositories>
    <repository>
        <id>central</id>
        <name>Central Repository</name>
        <url>http://repo.maven.apache.org/maven2</url>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>

...

<dependency>
    <groupId>com.arakelian</groupId>
    <artifactId>retry</artifactId>
    <version>6.0.1</version>
    <scope>test</scope>
</dependency>

Gradle

Add the following to your build.gradle:

repositories {
  mavenCentral()
}

dependencies {
  testCompile 'com.arakelian:retry:6.0.1'
}

Licence

Apache Version 2.0

Documentation

Javadoc can be found here.

License

The retry module is released under version 2.0 of the Apache License.

Contributors

  • Jean-Baptiste Nizet (JB)
  • Jason Dunkelberger (dirkraft)
  • Diwaker Gupta (diwakergupta)
  • Jochen Schalanda (joschi)
  • Shajahan Palayil (shasts)
  • Olivier Grégoire (fror)
  • Andrei Savu (andreisavu)
  • (tchdp)
  • (squalloser)
  • Yaroslav Matveychuk (yaroslavm)
  • Stephan Schroevers (Stephan202)
  • Chad (voiceinsideyou)
  • Kevin Conaway (kevinconaway)
  • Alberto Scotto (alb-i986)
  • Ryan Holder(rholder)

About

A Java library to allow for the creation of configurable retrying strategies for an arbitrary function call, such as something that communicates with a remote service.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages