Chapter 15. Handling failure and latency

 

This chapter covers

  • Introducing the circuit breaker pattern
  • Handling failure and latency with Hystrix
  • Monitoring circuit breakers
  • Aggregating circuit breaker metrics
 

15.1. Understanding circuit breakers

The circuit breaker pattern, as made popular in Release It!, 2nd edition, by Michael Nygard (Pragmatic Bookshelf, 2018) addresses the reality that the code we write will fail. What’s important is that when it fails, it fails gracefully. This powerful pattern is even more significant in the context of microservices, where it’s important to avoid letting failures cascade across a distributed call stack.

The idea of the circuit breaker pattern is relatively simple and is quite similar to a real-world electrical circuit breaker from which it gets its name. With an electrical circuit breaker, when the switch is in a closed position, the electricity flows through the circuits in a house, powering lights, televisions, computers, and appliances. But if there’s any fault in the line, such as a power surge, the circuit breaker opens, stopping the flow of electricity before it damages electronics or results in a house fire.

15.2. Declaring circuit breakers

 
 
 
 

15.3. Monitoring failures

 
 
 

15.4. Aggregating multiple Hystrix streams

 
 
 

Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest