Microservices Pattern
Circuit Breaker
Septeni Techtalk - 01/2018
tung_nt
What’s Circuit Breaker?
● The Circuit Breaker pattern, popularized by Michael
Nygard in his book, Release It!
● The Circuit Breaker provides a way to guard your
application against faulty external systems.
How does it works?
● Closed: The request from the application is routed to the operation.
● Open: The request from the application fails immediately and an exception is returned to the
application.
● Half-Open: A limited number of requests from the application are allowed to pass through and
invoke the operation.
When to use this pattern?
● The operation is highly likely to fail.
○ Ex: remote API, external system/services, ...
Implementations
● Akka CircuitBreaker
● Netflix Hystrix
● Apache Polygene’s CircuitBreaker
● ...
● And your implementation
Akka CircuitBreaker Sample
Refs
● https://martinfowler.com/bliki/CircuitBreaker.html
● https://polygene.apache.org/java/latest/library-circuitbreaker.html
● https://doc.akka.io/docs/akka/current/common/circuitbreaker.html?la
nguage=scala
Thank you

Circuit Breaker Pattern