Example

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.