Grokking Microservices Design Patterns
0% completed
Circuit Breaker Pattern: An Example
A breaker is a small state machine wrapped around a remote call. It is easier to trust once you have watched it move between its states, so this lesson runs it.
The Three States
The breaker is always in exactly one of three states, and each one answers the same question differently: may this call go through?
- CLOSED: yes. Calls pass, and failures in a row are counted.
- OPEN: no. Calls are refused at once, and the service is not contacted.
- HALF_OPEN: one call only, as a test of whether the service has recovered.
.....
.....
.....
Like the course? Get enrolled and start learning!
S
Shlomi Fisher
· 2 years ago
The code sample doesn't show how the rate of payment processing is slowed down when the circuit breaker is in HALF_OPEN state.
Show 2 replies
Reading Progress
0%