We are going to use a very simple use case to illustrate the circuit breaker. In this use case, we are going to invoke an external service and use a very simple fallback for demonstration purposes. Imagine if the external service fails due to the network, or perhaps the system is very busy and cannot handle the load, and the client could be forced to wait for up to 60 seconds before an exception occurs. By sending more and more requests to an already exhausted service, resources such as memory, connections, and threads could be exhausted, preventing other clients from getting serviced, and this will bring down the overall SLA of the system.

Implementing the circuit breaker in the client could help to solve this problem and handle ...

Get Industrial Internet Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.