Simulates Resilience4j CircuitBreaker with count-based sliding window. Building resilient Spring Boot services? Get in touch.
CallNotPermittedException — no call reaches the service. This gives the downstream system time to recover. After the wait duration, the breaker moves to HALF-OPEN.application.yml under resilience4j.circuitbreaker.instances. Use @CircuitBreaker(name="myService") on any @Service method. Wire Micrometer metrics via the Actuator dependency to expose state transitions to Prometheus.About this demo
The circuit breaker pattern prevents a failing dependency from cascading failures through the rest of the system. In the closed state, calls pass through normally and failures are counted. Once the failure rate crosses a threshold within a rolling window, the circuit trips open — subsequent calls are rejected immediately without hitting the failing service, giving it time to recover.
After a configured timeout, the circuit enters half-open: a limited number of probe requests are allowed through. If they succeed, the circuit closes again; if they fail, it returns to open. Use the controls to degrade the upstream service and watch the breaker transition through its states in real time.