{"id":30367091,"url":"https://github.com/vyag/sakura-retry","last_synced_at":"2026-04-16T15:32:56.552Z","repository":{"id":282431777,"uuid":"235591568","full_name":"vyag/sakura-retry","owner":"vyag","description":"An elegant JVM library for transient failure handling.","archived":false,"fork":false,"pushed_at":"2025-08-04T15:53:49.000Z","size":380,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T19:28:30.915Z","etag":null,"topics":["error-handling","failsafe","java","kotlin","kotlin-library","retry","retry-library","retry-strategies"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vyag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-22T14:31:55.000Z","updated_at":"2025-08-04T15:53:53.000Z","dependencies_parsed_at":"2025-03-29T18:21:06.351Z","dependency_job_id":"bb940fda-36e7-4984-a5ef-700f1ba19574","html_url":"https://github.com/vyag/sakura-retry","commit_stats":null,"previous_names":["marks-yag/retry","vyag/sakura-retry"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vyag/sakura-retry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyag%2Fsakura-retry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyag%2Fsakura-retry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyag%2Fsakura-retry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyag%2Fsakura-retry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vyag","download_url":"https://codeload.github.com/vyag/sakura-retry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyag%2Fsakura-retry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271236280,"owners_count":24723978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-handling","failsafe","java","kotlin","kotlin-library","retry","retry-library","retry-strategies"],"created_at":"2025-08-19T23:12:24.726Z","updated_at":"2025-10-30T11:22:48.118Z","avatar_url":"https://github.com/vyag.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central Version](https://img.shields.io/maven-central/v/com.github.marks-yag/sakura-retry)](https://maven-badges.herokuapp.com/maven-central/com.github.marks-yag/sakura-retry)\n![Maven Central Last Update](https://img.shields.io/maven-central/last-update/com.github.marks-yag/sakura-retry)\n[![Java CI with Maven](https://github.com/vyag/sakura-retry/actions/workflows/maven.yml/badge.svg)](https://github.com/vyag/sakura-retry/actions/workflows/maven.yml)\n\n[中文](README_cn.md) | English\n\n# Sakura Retry\n\nAn elegant(useless😉) and lightweight retry framework for JVM which supports:\n\n- Highly customizable retry and backoff policies.\n- Both synchronous and asynchronous execution.\n- Apply pre-defined retry template on existing object using dynamic proxy.\n\n*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.\n\n# Getting Started\n\nAvailable on [Maven Central](https://mvnrepository.com/artifact/com.github.marks-yag/sakura-retry).\n\n**Example：**\n\n```kotlin\nfun main() {\n    val retry = Retry.Builder()\n        .setCondition(maxAttempts(3))\n        .setBackoffPolicy(fixedDelayInSeconds(10) + randomDelayInSeconds(0, 1))\n        .addFailureListener(logging())\n        .build()\n    retry.call {\n        println(\"maybe fail\")\n    }\n}\n```\n\n**Basic Concepts:**\n\n- **Condition**: Determines whether to trigger or terminate retries.\n- **BackoffPolicy**: Defines the waiting interval between retries.\n- **FailureListener**: Handles (e.g., logging, alerting) upon execution failures.\n\n**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.\n\nFind more examples [here](demo/src/main).\n\n# License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyag%2Fsakura-retry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvyag%2Fsakura-retry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyag%2Fsakura-retry/lists"}