{"id":13433150,"url":"https://github.com/Netflix/Hystrix","last_synced_at":"2025-03-17T10:33:28.893Z","repository":{"id":5561545,"uuid":"6766558","full_name":"Netflix/Hystrix","owner":"Netflix","description":"Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.","archived":false,"fork":false,"pushed_at":"2023-10-17T13:04:47.000Z","size":9799,"stargazers_count":23864,"open_issues_count":401,"forks_count":4691,"subscribers_count":1665,"default_branch":"master","last_synced_at":"2024-04-14T04:55:05.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Netflix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-11-19T20:14:46.000Z","updated_at":"2024-04-13T22:02:30.000Z","dependencies_parsed_at":"2022-08-03T07:00:33.092Z","dependency_job_id":"f2c7b448-976a-4a59-bcf1-879b6ea13cca","html_url":"https://github.com/Netflix/Hystrix","commit_stats":{"total_commits":1473,"total_committers":146,"mean_commits":10.08904109589041,"dds":0.6503733876442634,"last_synced_commit":"3cb21589895e9f8f87cfcdbc9d96d9f63d48b848"},"previous_names":[],"tags_count":151,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2FHystrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2FHystrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2FHystrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2FHystrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Netflix","download_url":"https://codeload.github.com/Netflix/Hystrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244016981,"owners_count":20384247,"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","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":"2024-07-31T02:01:21.702Z","updated_at":"2025-03-17T10:33:28.883Z","avatar_url":"https://github.com/Netflix.png","language":"Java","readme":"\u003cimg src=\"https://netflix.github.io/Hystrix/images/hystrix-logo-tagline-850.png\"\u003e\n\n# Hystrix: Latency and Fault Tolerance for Distributed Systems\n\n[![NetflixOSS Lifecycle](https://img.shields.io/osslifecycle/Netflix/hystrix.svg)]()\n[![][travis img]][travis]\n[![][maven img]][maven]\n[![][license img]][license]\n\n# Hystrix Status\nHystrix is no longer in active development, and is currently in maintenance mode.\n\nHystrix (at version 1.5.18) is stable enough to meet the needs of Netflix for our existing applications. Meanwhile, our focus has shifted towards more adaptive implementations that react to an application’s real time performance rather than pre-configured settings (for example, through [adaptive concurrency limits](https://medium.com/@NetflixTechBlog/performance-under-load-3e6fa9a60581)). For the cases where something like Hystrix makes sense, we intend to continue using Hystrix for existing applications, and to leverage open and active projects like [resilience4j](https://github.com/resilience4j/resilience4j) for new internal projects. We are beginning to recommend others do the same.\n\nNetflix Hystrix is now officially in maintenance mode, with the following expectations to the greater community: \nNetflix will no longer actively review issues, merge pull-requests, and release new versions of Hystrix. \nWe have made a final release of Hystrix (1.5.18) per [issue 1891](https://github.com/Netflix/Hystrix/issues/1891) so that the latest version in Maven Central is aligned with the last known stable version used internally at Netflix (1.5.11). \nIf members of the community are interested in taking ownership of Hystrix and moving it back into active mode, please reach out to hystrixoss@googlegroups.com.\n\nHystrix has served Netflix and the community well over the years, and the transition to maintenance mode is in no way an indication that the concepts and ideas from Hystrix are no longer valuable. On the contrary, Hystrix has inspired many great ideas and projects. We thank everyone at Netflix, and in the greater community, for all the contributions made to Hystrix over the years.\n\n## Introduction\n\nHystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.\n\n## Full Documentation\n\nSee the [Wiki](https://github.com/Netflix/Hystrix/wiki/) for full documentation, examples, operational details and other information.\n\nSee the [Javadoc](http://netflix.github.com/Hystrix/javadoc) for the API.\n\n## Communication\n\n- Google Group: [HystrixOSS](http://groups.google.com/d/forum/hystrixoss)\n- Twitter: [@HystrixOSS](http://twitter.com/HystrixOSS)\n- [GitHub Issues](https://github.com/Netflix/Hystrix/issues)\n\n## What does it do?\n\n#### 1) Latency and Fault Tolerance\n\nStop cascading failures. Fallbacks and graceful degradation. Fail fast and rapid recovery. \n\nThread and semaphore isolation with circuit breakers. \n\n#### 2) Realtime Operations\n\nRealtime monitoring and configuration changes. Watch service and property changes take effect immediately as they spread across a fleet. \n\nBe alerted, make decisions, affect change and see results in seconds. \n\n#### 3) Concurrency\n\nParallel execution. Concurrency aware request caching. Automated batching through request collapsing.\n\n## Hello World!\n\nCode to be isolated is wrapped inside the run() method of a HystrixCommand similar to the following:\n\n```java\npublic class CommandHelloWorld extends HystrixCommand\u003cString\u003e {\n\n    private final String name;\n\n    public CommandHelloWorld(String name) {\n        super(HystrixCommandGroupKey.Factory.asKey(\"ExampleGroup\"));\n        this.name = name;\n    }\n\n    @Override\n    protected String run() {\n        return \"Hello \" + name + \"!\";\n    }\n}\n```\n\nThis command could be used like this:\n\n```java\nString s = new CommandHelloWorld(\"Bob\").execute();\nFuture\u003cString\u003e s = new CommandHelloWorld(\"Bob\").queue();\nObservable\u003cString\u003e s = new CommandHelloWorld(\"Bob\").observe();\n```\n\nMore examples and information can be found in the [How To Use](https://github.com/Netflix/Hystrix/wiki/How-To-Use) section.\n\nExample source code can be found in the [hystrix-examples](https://github.com/Netflix/Hystrix/tree/master/hystrix-examples/src/main/java/com/netflix/hystrix/examples) module.\n\n## Binaries\n\nBinaries and dependency information for Maven, Ivy, Gradle and others can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.hystrix%22%20AND%20a%3A%22hystrix-core%22).\n\nChange history and version numbers =\u003e [CHANGELOG.md](https://github.com/Netflix/Hystrix/blob/master/CHANGELOG.md)\n\nExample for Maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.netflix.hystrix\u003c/groupId\u003e\n    \u003cartifactId\u003ehystrix-core\u003c/artifactId\u003e\n    \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\nand for Ivy:\n\n```xml\n\u003cdependency org=\"com.netflix.hystrix\" name=\"hystrix-core\" rev=\"x.y.z\" /\u003e\n```\n\nIf you need to download the jars instead of using a build system, create a Maven pom file like this with the desired version:\n\n```xml\n\u003c?xml version=\"1.0\"?\u003e\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n\t\u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n\t\u003cgroupId\u003ecom.netflix.hystrix.download\u003c/groupId\u003e\n\t\u003cartifactId\u003ehystrix-download\u003c/artifactId\u003e\n\t\u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\t\u003cname\u003eSimple POM to download hystrix-core and dependencies\u003c/name\u003e\n\t\u003curl\u003ehttp://github.com/Netflix/Hystrix\u003c/url\u003e\n\t\u003cdependencies\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003ecom.netflix.hystrix\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ehystrix-core\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003ex.y.z\u003c/version\u003e\n\t\t\t\u003cscope/\u003e\n\t\t\u003c/dependency\u003e\n\t\u003c/dependencies\u003e\n\u003c/project\u003e\n```\n\nThen execute:\n\n```\nmvn -f download-hystrix-pom.xml dependency:copy-dependencies\n```\n\nIt will download hystrix-core-*.jar and its dependencies into ./target/dependency/.\n\nYou need Java 6 or later.\n\n## Build\n\nTo build:\n\n```\n$ git clone git@github.com:Netflix/Hystrix.git\n$ cd Hystrix/\n$ ./gradlew build\n```\n\nFurther details on building can be found on the [Getting Started](https://github.com/Netflix/Hystrix/wiki/Getting-Started) page of the wiki.\n\n## Run Demo\n\nTo run a [demo app](https://github.com/Netflix/Hystrix/tree/master/hystrix-examples/src/main/java/com/netflix/hystrix/examples/demo/HystrixCommandDemo.java) do the following:\n\n```\n$ git clone git@github.com:Netflix/Hystrix.git\n$ cd Hystrix/\n./gradlew runDemo\n```\n\nYou will see output similar to the following:\n\n```\nRequest =\u003e GetUserAccountCommand[SUCCESS][8ms], GetPaymentInformationCommand[SUCCESS][20ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][101ms], CreditCardCommand[SUCCESS][1075ms]\nRequest =\u003e GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS][2ms], GetPaymentInformationCommand[SUCCESS][22ms], GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][130ms], CreditCardCommand[SUCCESS][1050ms]\nRequest =\u003e GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS][4ms], GetPaymentInformationCommand[SUCCESS][19ms], GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][145ms], CreditCardCommand[SUCCESS][1301ms]\nRequest =\u003e GetUserAccountCommand[SUCCESS][4ms], GetPaymentInformationCommand[SUCCESS][11ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][93ms], CreditCardCommand[SUCCESS][1409ms]\n\n#####################################################################################\n# CreditCardCommand: Requests: 17 Errors: 0 (0%)   Mean: 1171 75th: 1391 90th: 1470 99th: 1486 \n# GetOrderCommand: Requests: 21 Errors: 0 (0%)   Mean: 100 75th: 144 90th: 207 99th: 230 \n# GetUserAccountCommand: Requests: 21 Errors: 4 (19%)   Mean: 8 75th: 11 90th: 46 99th: 51 \n# GetPaymentInformationCommand: Requests: 21 Errors: 0 (0%)   Mean: 18 75th: 21 90th: 24 99th: 25 \n#####################################################################################\n\nRequest =\u003e GetUserAccountCommand[SUCCESS][10ms], GetPaymentInformationCommand[SUCCESS][16ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][51ms], CreditCardCommand[SUCCESS][922ms]\nRequest =\u003e GetUserAccountCommand[SUCCESS][12ms], GetPaymentInformationCommand[SUCCESS][12ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][68ms], CreditCardCommand[SUCCESS][1257ms]\nRequest =\u003e GetUserAccountCommand[SUCCESS][10ms], GetPaymentInformationCommand[SUCCESS][11ms], GetUserAccountCommand[SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][78ms], CreditCardCommand[SUCCESS][1295ms]\nRequest =\u003e GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS][6ms], GetPaymentInformationCommand[SUCCESS][11ms], GetUserAccountCommand[FAILURE, FALLBACK_SUCCESS, RESPONSE_FROM_CACHE][0ms]x2, GetOrderCommand[SUCCESS][153ms], CreditCardCommand[SUCCESS][1321ms]\n```\n\nThis demo simulates 4 different [HystrixCommand](https://github.com/Netflix/Hystrix/tree/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java) implementations with failures, latency, timeouts and duplicate calls in a multi-threaded environment.\n\nIt logs the results of [HystrixRequestLog](https://github.com/Netflix/Hystrix/tree/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixRequestLog.java) and metrics from [HystrixCommandMetrics](https://github.com/Netflix/Hystrix/tree/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommandMetrics.java).\n\n## Dashboard\n\nThe hystrix-dashboard component of this project has been deprecated and moved to [Netflix-Skunkworks/hystrix-dashboard](https://github.com/Netflix-Skunkworks/hystrix-dashboard). Please see the README there for more details including important security considerations.\n\n\n## Bugs and Feedback\n\nFor bugs, questions and discussions please use the [GitHub Issues](https://github.com/Netflix/Hystrix/issues).\n\n \n## LICENSE\n\nCopyright 2013 Netflix, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\n[travis]:https://travis-ci.org/Netflix/Hystrix\n[travis img]:https://travis-ci.org/Netflix/Hystrix.svg?branch=master\n\n[maven]:http://search.maven.org/#search|gav|1|g:\"com.netflix.hystrix\"%20AND%20a:\"hystrix-core\"\n[maven img]:https://maven-badges.herokuapp.com/maven-central/com.netflix.hystrix/hystrix-core/badge.svg\n\n[release]:https://github.com/netflix/hystrix/releases\n[release img]:https://img.shields.io/github/release/netflix/hystrix.svg\n\n[license]:LICENSE-2.0.txt\n[license img]:https://img.shields.io/badge/License-Apache%202-blue.svg\n\n","funding_links":[],"categories":["Java","Java (78)","Container registries","Orchestration \u0026 Management","HarmonyOS","Distributed Applications","Reliability \u0026 Chaos Engineering","Circuit Breaker \u0026 Bulkheads","Infrastructure","I. Development","中间件","Chaos Engineering and Fault Injection","Capabilities","容错组件","Projects","Technologies we used in the Microservices","Solutions","\u003ca name=\"Java\"\u003e\u003c/a\u003eJava"],"sub_categories":["Windows Manager","Client-side","Resilience","9. Distributed Applications","Resilience Testing","Distributed Applications","Circuit Breaker"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetflix%2FHystrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNetflix%2FHystrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetflix%2FHystrix/lists"}