{"id":33178975,"url":"https://github.com/microprofile/microprofile-fault-tolerance","last_synced_at":"2026-02-23T09:59:10.471Z","repository":{"id":45315124,"uuid":"89961630","full_name":"microprofile/microprofile-fault-tolerance","owner":"microprofile","description":"microprofile fault tolerance","archived":false,"fork":false,"pushed_at":"2025-03-11T12:10:01.000Z","size":1929,"stargazers_count":134,"open_issues_count":18,"forks_count":62,"subscribers_count":34,"default_branch":"main","last_synced_at":"2026-01-11T19:36:01.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/microprofile.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.adoc","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}},"created_at":"2017-05-01T20:47:19.000Z","updated_at":"2025-11-29T11:07:05.000Z","dependencies_parsed_at":"2023-02-13T19:02:47.778Z","dependency_job_id":"1e6290f9-ea5d-4038-ac7c-0d1433291bce","html_url":"https://github.com/microprofile/microprofile-fault-tolerance","commit_stats":null,"previous_names":["microprofile/microprofile-fault-tolerance","eclipse/microprofile-fault-tolerance"],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/microprofile/microprofile-fault-tolerance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microprofile%2Fmicroprofile-fault-tolerance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microprofile%2Fmicroprofile-fault-tolerance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microprofile%2Fmicroprofile-fault-tolerance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microprofile%2Fmicroprofile-fault-tolerance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microprofile","download_url":"https://codeload.github.com/microprofile/microprofile-fault-tolerance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microprofile%2Fmicroprofile-fault-tolerance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-11-16T03:00:36.817Z","updated_at":"2026-02-23T09:59:10.404Z","avatar_url":"https://github.com/microprofile.png","language":"Java","funding_links":[],"categories":["容错组件"],"sub_categories":[],"readme":"//\n// Copyright (c) 2016-2019 Contributors to the Eclipse Foundation\n//\n// See the NOTICE file(s) distributed with this work for additional\n// information regarding copyright ownership.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// You may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\nimage:https://badges.gitter.im/eclipse/microprofile-fault-tolerance.svg[link=\"https://gitter.im/eclipse/microprofile-fault-tolerance\"]\n\n# Eclipse MicroProfile Fault Tolerance\n\n## Introduction\n\nIt is increasingly important to build fault tolerant micro services. Fault tolerance is about leveraging different strategies to guide the execution and result of some logic. Retry policies, bulkheads, and circuit breakers are popular concepts in this area. They dictate whether and when executions should take place, and fallbacks offer an alternative result when an execution does not complete successfully.\n\n## Overview \n\nFault Tolerance provides developers with the following strategies for dealing with failure:\n\n* Timeout: Define a maximum duration for execution\n* Retry: Attempt execution again if it fails\n* Bulkhead: Limit concurrent execution so that failures in that area can't overload the whole system\n* CircuitBreaker: Automatically fail fast when execution repeatedly fails\n* Fallback: Provide an alternative solution when execution fails\n\nFault Tolerance provides an annotation for each strategy which can be placed on the methods of CDI beans. When an annotated method is called, the call is intercepted and the corresponding fault tolerance strategies are applied to the execution of that method.\n\n## Documentation\n\nFor links to the latest maven artifacts, Javadoc and specification document, see the link:https://github.com/eclipse/microprofile-fault-tolerance/releases/latest[latest release].\n\n## Example\n\nApply the retry and fallback strategies to `doWork()`. It will be executed up to two additional times if if throws an exception. If all executions throw an exception, `doWorkFallback()` will be called and the result of that returned instead.\n\n```java\n@ApplicationScoped\npublic class FaultToleranceBean {\n   \n   @Retry(maxRetries = 2)\n   @Fallback(fallbackMethod = \"doWorkFallback\")\n   public Result doWork() {\n      return callServiceA(); // This service usually works but sometimes\n                             // throws a RuntimeException\n   }\n   \n   private Result doWorkFallback() {\n      return Result.emptyResult();\n   }\n}\n```\n\nFrom elsewhere, inject the `FaultToleranceBean` and call the method:\n\n```java\n@ApplicationScoped\npublic class TestBean {\n\n    @Inject private FaultToleranceBean faultToleranceBean;\n    \n    public void test() {\n        Result theResult = faultToleranceBean.doWork();\n    }\n}\n```\n\n### Configuration\n\nThe annotation parameters can be configured via MicroProfile Config. For example, imagine you have the following code in your application:\n\n```java\npackage org.microprofile.readme;\n\n@ApplicationScoped\npublic class FaultToleranceBean {\n\n   @Retry(maxRetries = 2)\n   public Result doWork() {\n      return callServiceA(); // This service usually works but sometimes\n                             // throws a RuntimeException\n   }\n}\n```\n\nAt runtime, you can configure `maxRetries` to be `6` instead of `2` for this method by defining the config property `org.microprofile.readme.FaultToleranceBean/doWork/Retry/maxRetries=6`.\n\nAlternatively, you can configure `maxRetries` to be `6` for all instances of `Retry` in your application by specifying the property `Retry/maxRetries=6`.\n\n\n## Contributing\n\nDo you want to contribute to this project? link:CONTRIBUTING.adoc[Find out how you can help here].","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicroprofile%2Fmicroprofile-fault-tolerance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicroprofile%2Fmicroprofile-fault-tolerance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicroprofile%2Fmicroprofile-fault-tolerance/lists"}