Quick revision
The short answer
A Bus refresh applies one change to all 40 instances at the same moment, so a bad value has no chance to show itself on a few instances first. I would treat configuration like code, with review, validation and tests in CI, validate properties in the application so a bad value is rejected at startup and on refresh, roll changes out to a canary group before the rest, keep rollback one Git revert away, and move settings that are dangerous to change at runtime back to normal deployments.
What to remember
In this answer, we saw that the outage was total because a Bus refresh applies one change to every instance at once and skips the protections code changes get. We fixed the process in layers: review and CI checks for configuration, @Validated @ConfigurationProperties so services reject bad values, canary refreshes or rolling restarts instead of a broadcast, a scripted rollback through Git, and a clear rule that only settings designed for it may change at runtime.
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.
A Bus refresh applies one change to all 40 instances at the same moment, so a bad value has no chance to show itself on a few instances first. I would treat configuration like code, with review, validation and tests in CI, validate properties in the application so a bad value is rejected at startup and on refresh, roll changes out to a canary group before the rest, keep rollback one Git revert away, and move settings that are dangerous to change at runtime back to normal deployments.
Why this question is asked
This scenario is common because Spring Cloud Config with Spring Cloud Bus makes the dangerous path the convenient one: push to Git, call busrefresh, and every instance changes at once. When it works it feels like magic; when it fails, it fails everywhere together, which is worse than most code bugs, since code goes through a pipeline that usually rolls out gradually. Interviewers ask this to see whether we can redesign a process, not just fix the one value. In this answer, we will look at why the outage was total, then work through the changes: checks before the change is merged, validation inside the application, gradual rollout instead of broadcast, fast rollback, and a decision about which settings may change at runtime at all.
1Why One Change Took Down Everything
Let us picture what happened. Someone changed orders.http.pool-size from 50 to 5, or typed a database URL with a missing character, and pushed to the Git repository behind the Config Server. A webhook or a person called /actuator/busrefresh. Spring Cloud Bus sent a refresh event through the broker, and all 40 instances fetched the new configuration and applied it within a second or two.
The problem is not that a bad value was written. People will always make mistakes. The problem is that the process had no stage where the mistake could be caught while it only affected a few instances. Code changes normally go through review, tests and a rolling deployment with health checks, and a rolling deployment stops when new instances fail to become ready. The configuration path skipped every one of those protections. So the fix is to give configuration the same protections, in proportion to the risk.
- Edit orders-prod.ymlno review, no checks
- Push to GitConfig Server serves it at once
- POST /actuator/busrefreshone event to the broker
- All 40 instances refreshat the same moment
- All 40 failnothing left to serve traffic
5 steps in order. Play them, or step through them one at a time.
Each step was fast, and no step could stop the change.
2Treat Configuration Like Code
The first change is upstream. Configuration files live in Git already, so we can use the same tools we use for code. Changes go through a pull request with a required reviewer from the owning team. A CI job then checks them before they can be merged: the YAML parses, every key is known, every value has the right type and range, and URLs point to hosts that exist in that environment.
The most effective check is to start the application against the new configuration in CI. A Spring Boot test that loads the context with the prod profile and the proposed files will fail on the same validation errors the real instances would hit, without touching production. Notice that this only works if the application itself knows what a valid value is, which brings us to the next step.
3Validate Properties Inside the Application
We should make the service refuse bad values instead of running with them. Spring Boot does this when we put settings in a @ConfigurationProperties class annotated with @Validated and add Jakarta Bean Validation constraints. A value that breaks a constraint fails startup with a clear message naming the property.
The same binding and validation run again when a refresh rebinds the properties, so the bad value is reported instead of being accepted quietly. Check your version for exactly what happens to the bean after a failed rebind, and test it, because the safest design catches the bad value in CI or on a canary before any broad refresh. Validation turns a crash in production into an error message in CI or on the first canary.
4Roll Out Gradually Instead of Broadcasting
Even with checks, some mistakes are only visible under real traffic: a timeout that is valid but too short, a limit that is too low for peak hours. So the change should reach a few instances first. Spring Cloud Bus can address a destination instead of everyone: POST /actuator/busrefresh/orders:** refreshes only instances whose bus id matches the pattern, and if we give canary instances a distinctive bus id we can target just them (check your version for the default id format). We can also refresh canary instances one by one with /actuator/refresh, watch error rate and latency for ten or fifteen minutes, and only then refresh the remaining 36.
A simpler and often better way is to stop refreshing at runtime and let the deployment platform do the rollout. If a configuration change triggers a normal rolling restart, Kubernetes replaces instances a few at a time, and the readiness probe stops the rollout when new instances fail to start. Our @Validated properties then work as an automatic brake.
- Pull request with reviewowner team approves
- CI: start the app with the new configvalidation and tests
- Merge to the release label
- Refresh or restart 2 canary instances
- Error rate and latency normal after 15 min?YesRoll out to the other 38NoRevert in Git and refresh canaries
5 steps in order. Play them, or step through them one at a time.
The broadcast is replaced by a canary step that can stop the change.
5Fast Rollback and Choosing What May Change at Runtime
Because every change is a Git commit, rollback is a git revert followed by the same refresh. We should rehearse it and keep it scripted, so that during an incident nobody has to think. Pinning clients to a label, such as a release tag, also helps: the server keeps serving the old tag until we move it on purpose, so an accidental push to main does not reach production.
Finally, we should ask which settings really need to change without a deployment. Feature switches, log levels and some limits do. Pool sizes, database URLs, security settings and anything read once at startup do not, and refreshing them is either useless or dangerous. For those, a normal deployment with its rolling restart and health checks is the safer channel, and the refresh endpoint can be limited to properties that are designed for it.
6Follow-up questions
Should we just turn off Spring Cloud Bus?
Not necessarily. The Bus is useful for settings that are designed to change at runtime and are validated, such as feature switches. The mistake was using it as the only rollout path for every setting. Keep it for the narrow cases, address canary destinations first, and route everything else through normal deployments.
How do we know the canary is healthy?
We decide in advance which signals count: error rate, p99 latency and saturation for the canary instances compared with the rest, plus the service's own health and readiness. An automated check, or at least a dashboard with clear thresholds, compares them for a fixed window such as 15 minutes before the change goes further.
What about values that fail only at use time, not at binding?
Validation catches types and ranges, but not a URL that is valid yet points to the wrong host. For these, CI can resolve or call the target in the test environment, and the canary step catches what remains under real traffic. That is why we need both layers rather than either one.
7Conclusion
In this answer, we saw that the outage was total because a Bus refresh applies one change to every instance at once and skips the protections code changes get. We fixed the process in layers: review and CI checks for configuration, @Validated @ConfigurationProperties so services reject bad values, canary refreshes or rolling restarts instead of a broadcast, a scripted rollback through Git, and a clear rule that only settings designed for it may change at runtime.
Open with
The real issue is that a Bus refresh is a broadcast: one push changed all 40 instances at the same moment, with none of the protections our code deployments have.
Then, if they want more
I would fix the process in a few layers. First, treat configuration like code: changes go through a pull request with a reviewer from the owning team, and CI validates them, ideally by starting the application with the proposed files and the prod profile, so a bad value fails the build.
Second, make the application defend itself by putting settings in @Validated @ConfigurationProperties classes with constraints like @Min and @NotBlank, so an invalid value is rejected at startup and not applied on refresh. Third, stop broadcasting.
Either refresh a canary group first using a Bus destination or individual refresh calls, watch error rate and latency for a fixed window, and then continue, or simply turn configuration changes into rolling restarts, where readiness probes stop the rollout automatically.
Fourth, keep rollback trivial: a git revert and the same refresh, scripted and rehearsed, and pin production to a release label so an accidental push to main does not reach it. Finally, I would agree which settings may change at runtime at all. Feature switches and log levels, yes. Pool sizes, URLs and security settings should go through a normal deployment.
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 bad configuration change pushed through Spring Cloud Config with Bus refresh took down...": https://scrivio-interview-library.netlify.app/spring-boot/spring-cloud/bfc929e4a5/