Quick revision
The short answer
On the admin endpoint, the breaker never reaches minimumNumberOfCalls (100 by default), so it never computes a failure rate and never opens; we lower minimumNumberOfCalls or use a time-based window sized for the traffic. On the busy endpoint, one breaker covers every request to the dependency, so failures caused by one customer's data push the shared failure rate over the threshold and block everyone. We fix that by not counting client errors or business exceptions as failures and by choosing a breaker granularity per dependency and operation that is neither too coarse nor too fine.
What to remember
In this answer, we explained two opposite circuit breaker failures. The quiet admin endpoint never reaches minimumNumberOfCalls, so its breaker never evaluates a failure rate; we lower that minimum and size the window to the traffic. The busy endpoint shares one breaker across all customers, so one customer's errors open it for everyone; we stop counting client and business errors as failures and pick a granularity per dependency and operation, with dedicated breakers only where one tenant dominates.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
On the admin endpoint, the breaker never reaches minimumNumberOfCalls (100 by default), so it never computes a failure rate and never opens; we lower minimumNumberOfCalls or use a time-based window sized for the traffic. On the busy endpoint, one breaker covers every request to the dependency, so failures caused by one customer's data push the shared failure rate over the threshold and block everyone. We fix that by not counting client errors or business exceptions as failures and by choosing a breaker granularity per dependency and operation that is neither too coarse nor too fine.
Why this question is asked
These two symptoms look opposite, a breaker that is too lazy and one that is too eager, but both come from the same misunderstanding: what exactly the breaker counts and over which calls. Interviewers combine them to see whether we can reason from the breaker's rules to the behaviour we see. In this answer, we will recap how the breaker decides, explain why the low-traffic breaker never opens and fix it, explain why one customer can open the breaker for everyone and fix that, and finish with how to choose breaker granularity.
1A Quick Recap: What the Breaker Counts
A Resilience4j circuit breaker records the outcome of each call in a sliding window, either the last N calls (count-based) or the last N seconds (time-based). It opens when the failure rate over that window is at or above failureRateThreshold. But there is a precondition: the window must contain at least minimumNumberOfCalls outcomes before the rate is calculated at all.
What counts as a failure is also configurable. By default every exception counts. recordExceptions narrows that to a list, and ignoreExceptions marks exceptions that count as neither success nor failure. So the breaker's behaviour depends on traffic volume, window settings and exception classification together.
2Problem 1: The Admin Breaker Never Opens
The admin endpoint gets perhaps 30 calls an hour, and every one of them fails. Let us see what the breaker does with the defaults.
| Settings | After 5 failed calls | After 30 failed calls |
|---|---|---|
| Default: window 100, minimum 100 | CLOSED | CLOSED |
| Count window 10, minimum 5 | OPEN | OPEN |
| Time window 300 s, minimum 5 | OPEN | OPEN |
Notice that a 100 percent failure rate does not matter, because the breaker refuses to compute any rate until it has 100 results. At 30 calls an hour, that takes more than three hours, and if the instance restarts in between, the count starts again from zero. Each call still waits for a full timeout, which is what makes the admin page hang.
The fix is to size the settings to the traffic. For a quiet endpoint, a minimumNumberOfCalls of 5 and a count-based window of 10 means five consecutive failures open the breaker. Alternatively, a time-based window of 300 seconds with minimumNumberOfCalls of 5 evaluates whatever happened in the last five minutes. Notice that switching to a time-based window alone does not help: minimumNumberOfCalls still applies, so it must be lowered too.
3Problem 2: One Customer Opens the Breaker for Everyone
The high-traffic endpoint has one breaker for the whole pricing dependency. A single large customer has a misconfigured catalogue, so every pricing call for that customer fails, and that customer sends 60 percent of the traffic at the moment. The breaker sees a 60 percent failure rate, which is above the 50 percent threshold, and opens. Now every customer gets CallNotPermittedException, although pricing works perfectly for all of them except one.
The breaker did exactly what it was told. It treats all calls to the dependency as one population and has no idea that the failures share a cause. There are two separate mistakes here, and they have separate fixes.
4Fix 1: Count Only Failures That Mean the Dependency Is Unhealthy
A breaker should open when the dependency is unhealthy, not when a request is bad. If the failing customer's calls come back as 400 Bad Request or 404 Not Found, or our code throws a business exception such as UnknownProductException, those are not signs of an unhealthy service. Counting them is the most common reason a breaker opens for everyone.
With this classification, the customer's failures still reach our error handling and logs, but they do not move the breaker. If the customer's requests cause real 5xx errors on the pricing side, which can happen with poisoned data, we need the second fix as well.
5Fix 2: Choose the Right Breaker Granularity
Granularity means how many calls share one breaker. One breaker per dependency is the usual starting point, but a dependency with very different operations may need one per operation, for example a pricing breaker for quotes and another for bulk export, so a broken export cannot block quotes. When one tenant's data can genuinely break the dependency, a per-tenant breaker for the largest tenants, or for the failing key, contains the damage.
But finer is not always better. Each breaker needs enough calls to reach minimumNumberOfCalls, so a breaker per customer for 10,000 small customers would never open, recreating problem 1, and would cost memory and metric series. A sensible rule is a breaker per dependency and operation, plus dedicated breakers only for the few tenants big enough to dominate traffic. Resilience4j's CircuitBreakerRegistry can create breakers by name on demand, such as pricing-quote or pricing-tenant-acme, using a shared configuration.
| Granularity | Benefit | Risk |
|---|---|---|
| One per service | simple | any failure blocks all calls |
| Per dependency | usual default | one bad operation blocks the rest |
| Per dependency and operation | isolates heavy or fragile operations | a few more to configure |
| Per tenant (large ones only) | contains one customer's damage | too fine never reaches minimum calls |
6Follow-up questions
Why not just set minimumNumberOfCalls to 1 everywhere?
Because then a single failed call can open the breaker on a busy endpoint, which makes it flap open and closed on ordinary noise. The minimum should be large enough for the rate to mean something at that endpoint's traffic, which is why quiet and busy endpoints need different values.
Should a timeout count as a failure?
Yes. A timeout is one of the clearest signs that a dependency is unhealthy. We can also use the slow call threshold so calls that succeed but take too long, for example over 2 seconds, open the breaker before they turn into timeouts.
How would you notice the second problem in production?
The breaker state metric shows OPEN while the dependency's own dashboards are green, and the errors in the logs all share one customer id or one input. That mismatch between our breaker and the dependency's health points to classification or granularity.
7Conclusion
In this answer, we explained two opposite circuit breaker failures. The quiet admin endpoint never reaches minimumNumberOfCalls, so its breaker never evaluates a failure rate; we lower that minimum and size the window to the traffic. The busy endpoint shares one breaker across all customers, so one customer's errors open it for everyone; we stop counting client and business errors as failures and pick a granularity per dependency and operation, with dedicated breakers only where one tenant dominates.
Open with
These are two sides of how the breaker counts. On the admin endpoint, the breaker only calculates a failure rate once it has minimumNumberOfCalls results, and the default is one hundred.
Then, if they want more
At thirty calls an hour it never gets there, especially if the instance restarts, so it stays closed even with every call failing, and each call still waits for a full timeout.
I would lower minimumNumberOfCalls to something like five with a small count window, or use a time-based window of a few minutes, remembering that the time-based window alone does not help because the minimum still applies.
On the busy endpoint, one breaker covers all requests to the dependency, so when one big customer's requests fail and make up most of the traffic, the shared failure rate passes fifty percent and the breaker blocks everyone.
First I would check classification: if those failures are 4xx or business exceptions, they say the request is bad, not that the dependency is unhealthy, so they go into ignoreExceptions and only I/O errors, timeouts and 5xx go into recordExceptions.
Second, granularity: I would use a breaker per dependency and operation, and for the few tenants large enough to dominate traffic, a dedicated breaker, but not one per small customer, because those would never reach the minimum calls and we would be back to the first problem.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Cloud documentation, Resilience4j documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "A circuit breaker on a low-traffic admin endpoint never opens although the dependency...": https://scrivio-interview-library.netlify.app/spring-boot/resilience/90b7c3ed8d/