Cette page est affichée en anglais. Une traduction française est en cours.
SkillsMay 13, 2026·3 min de lecture

Hystrix — Latency and Fault Tolerance Library for Distributed Systems

Hystrix is a Netflix open-source library that isolates remote service calls, prevents cascading failures, and provides real-time monitoring dashboards for JVM-based microservice architectures.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Hystrix Fault Tolerance
Commande CLI universelle
npx tokrepo install b8895f72-4eca-11f1-9bc6-00163e2b0d79

Introduction

Hystrix implements the circuit breaker pattern for JVM applications. When a downstream service becomes slow or unavailable, Hystrix short-circuits requests and routes them to a fallback, protecting the calling service from cascading failures.

What Hystrix Does

  • Wraps remote calls in isolated thread pools or semaphores to contain failures
  • Opens a circuit breaker when error rates exceed a configurable threshold
  • Routes failed or timed-out requests to developer-defined fallback logic
  • Publishes real-time metrics via an event stream for the Hystrix Dashboard
  • Provides request caching and request collapsing for batching

Architecture Overview

Each Hystrix command runs inside its own thread pool (bulkhead pattern), preventing a slow dependency from consuming all application threads. A sliding-window health monitor tracks success, failure, timeout, and rejection rates. When failures cross the threshold, the circuit opens and all requests go to the fallback for a configurable sleep window before half-open probing resumes.

Self-Hosting & Configuration

  • Add hystrix-core as a Maven or Gradle dependency in any JVM project
  • Configure per-command thread pool sizes, timeouts, and circuit breaker thresholds via Archaius or static properties
  • Deploy the Hystrix Dashboard WAR alongside your service for real-time monitoring
  • Use Turbine to aggregate metrics streams across a cluster
  • Integrates with Spring Cloud Netflix for annotation-driven usage

Key Features

  • Bulkhead isolation keeps failing dependencies from taking down the whole service
  • Configurable circuit breaker with automatic recovery probing
  • Real-time streaming dashboard for observing command health
  • Request collapsing reduces fan-out by batching concurrent calls
  • Mature and battle-tested at Netflix scale

Comparison with Similar Tools

  • Resilience4j — modern lightweight successor designed for Java 8+; recommended for new projects since Hystrix is in maintenance mode
  • Sentinel (Alibaba) — broader flow control and system protection; more features but heavier
  • Polly (.NET) — equivalent circuit breaker library for the .NET ecosystem
  • Istio/Envoy — implements circuit breaking at the service mesh layer rather than in application code

FAQ

Q: Is Hystrix still maintained? A: Hystrix entered maintenance mode in 2018. Netflix recommends Resilience4j for new projects, but Hystrix remains stable and widely deployed.

Q: Can I use Hystrix without Spring Cloud? A: Yes. Hystrix is a standalone library; Spring Cloud Netflix is an optional integration layer.

Q: How does the circuit breaker decide when to open? A: It uses a rolling time window to track error percentages. When the error rate exceeds the configured threshold and minimum request volume, the circuit opens.

Q: Does Hystrix work with reactive frameworks? A: Hystrix includes an RxJava-based observable command variant for reactive pipelines.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires