GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vyag/sakura-retry: An elegant JVM library for transient failure handling.

BranchesTags
Open more actions menu

Latest commit

 

History

308 Commits
308 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
core
core
 
 
demo
demo
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README_cn.md
README_cn.md
 
 
pom.xml
pom.xml
 
 
pom.xml.versionsBackup
pom.xml.versionsBackup
 
 

Repository files navigation

Maven Central Version Maven Central Last Update Java CI with Maven

中文 | English

Sakura Retry

An elegant(useless😉) and lightweight retry framework for JVM which supports:

  • Highly customizable retry and backoff policies.
  • Both synchronous and asynchronous execution.
  • Apply pre-defined retry template on existing object using dynamic proxy.

Sakura Retry does NOT attempt to support more features than other mainstream retry frameworks, nor does it offer better performance. In the early years, I started writing Sakura Retry due to a lack of information, and I have kept using it because I like it more and more in terms of aesthetics.

Getting Started

Available on Maven Central.

Example:

fun main() {
    val retry = Retry.Builder()
        .setCondition(maxAttempts(3))
        .setBackoffPolicy(fixedDelayInSeconds(10) + randomDelayInSeconds(0, 1))
        .addFailureListener(logging())
        .build()
    retry.call {
        println("maybe fail")
    }
}

Basic Concepts:

  • Condition: Determines whether to trigger or terminate retries.
  • BackoffPolicy: Defines the waiting interval between retries.
  • FailureListener: Handles (e.g., logging, alerting) upon execution failures.

RetryPolicy supports logical composition (e.g., maxAttempts(10) and !runtimeException()) to express complex retry strategies through a single concept. BackoffPolicy allows combinable configurations (e.g., fixedDelayInSeconds(10) + randomDelayInSeconds(0, 1)), which represents a 10-second fixed delay with an additional 0–1 second random jitter.

Find more examples here.

License

Apache License 2.0

About

An elegant JVM library for transient failure handling.

Topics

error-handlingfailsafejavakotlinkotlin-libraryretryretry-libraryretry-strategies

Resources

Readme
Apache-2.0 license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.