Skip to content

Circuit breaker

A circuit breaker stops calls to a failing service and later allows limited probe calls to check recovery.

APIs and data contracts

A circuit breaker protects an application from continually calling a failing dependency. It evaluates selected failures and decides whether further calls may pass through. After a defined waiting period, limited probe calls can check whether the service has recovered.

Three states with different permissions

In closed, calls pass normally. In open, they are rejected without being forwarded to the affected service. half-open permits only limited probe calls; their results determine whether calls are blocked again or normal operation resumes.

In a fictional customer portal, the PDF reporting service fails. The open circuit breaker prevents new calls to that service, and the portal shows that it is temporarily unavailable. This does not itself save a report job in a queue or repair the service.

The team defines failure types, the evaluation window, threshold, waiting period and fallback behaviour. A timeout limits the duration of one call; a retry starts another attempt. The circuit breaker decides whether a call is forwarded. These mechanisms can work together, but their rules need to be coordinated.

Sources