Quick revision
The short answer
The service is not really reactive: every request still waits on a blocking call, only now on a boundedElastic thread instead of a Tomcat thread, and it pays extra for operator overhead and for hopping between the event loop and the pool. Reactive brings benefits only when the I/O stack is non-blocking end to end. I would measure where the time goes and then choose deliberately: replace the blocking dependencies with non-blocking ones if the workload justifies it, or move back to Spring MVC, ideally with virtual threads, and write down a standard for when a service should be reactive.
What to remember
In this answer, we saw that wrapping every call in subscribeOn(boundedElastic) keeps the blocking model of MVC, often with a smaller pool, and adds operator overhead and thread hops, so worse throughput is expected. Reactive pays off only with non-blocking I/O end to end and high concurrency. We compared going fully non-blocking, moving back to MVC with virtual threads and isolating the blocking part, chose by benchmarking real load rather than by sunk cost, and wrote a standard so new services are reactive only when the workload and the stack support it.
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.
The service is not really reactive: every request still waits on a blocking call, only now on a boundedElastic thread instead of a Tomcat thread, and it pays extra for operator overhead and for hopping between the event loop and the pool. Reactive brings benefits only when the I/O stack is non-blocking end to end. I would measure where the time goes and then choose deliberately: replace the blocking dependencies with non-blocking ones if the workload justifies it, or move back to Spring MVC, ideally with virtual threads, and write down a standard for when a service should be reactive.
Why this question is asked
This is a common situation a few years after a reactive migration. The code uses Mono and Flux everywhere, the team has learned a hard programming model, and yet the service is slower and harder to debug than the MVC one it replaced. Interviewers ask it at senior level because the right answer is neither "reactive is bad" nor "just tune the pool". It is an analysis of where the time goes and a decision made on evidence, with the team's sunk cost set aside. In this answer, we will see why wrapping everything in subscribeOn is slower, check what reactive needs to pay off, compare the realistic options, and describe how we would decide and what standard we would leave behind.
1Why Wrapping Everything in subscribeOn Is Slower
In the old MVC service, each request ran on one Tomcat thread from start to finish. That thread blocked on JPA, on the SOAP client and on file I/O, and Tomcat's pool of 200 threads decided how many requests could be in progress.
In the new service, each request arrives on a Netty event loop, hops to a boundedElastic thread for the JPA call, comes back, hops again for the SOAP call, and again for the file read. Each hop means queueing a task, waking a thread and moving data between CPU caches. Each Mono and operator allocates objects. The blocking still happens; it has only moved to a pool whose cap, ten times the cores, may be smaller than Tomcat's 200 threads. So we have the same blocking model with a smaller pool, plus overhead. Being slower is the expected result, not a mystery.
8 messages in order. Play them, or step through them one at a time.
A thread still waits for every call; the hops and operators are extra cost.
2What Reactive Needs to Pay Off
Reactive programming saves threads by not waiting. A thread sends a request, registers a callback, and moves on to other work; the result is handled when it arrives. That saves anything only if the call underneath is truly non-blocking, like WebClient over Netty, R2DBC, or a reactive Redis or Kafka client. One blocking dependency in the path means one thread waiting per request, wherever we put it.
And the savings only matter at high concurrency. If the service handles 300 concurrent requests, 300 waiting threads are cheap, especially with virtual threads. Reactive pays off with thousands of concurrent slow calls, long-lived streaming connections or high fan-out, where waiting threads would be the bottleneck. So the first questions are what share of each request's time is spent in blocking calls, and how many requests are in flight at peak.
3The Options and What Each Costs
With measurements in hand, there are two honest paths and one tempting non-path. The tempting non-path is to tune: raise the boundedElastic cap to 200 threads and call it done. That makes the reactive service behave like the MVC one with extra overhead, which is the worst of both.
| Option | What it takes | When it is right |
|---|---|---|
| Go fully non-blocking | R2DBC instead of JPA, async SOAP or a new API, async file I/O | high concurrency, streaming, fan-out |
| Back to MVC on virtual threads | rewrite controllers, keep JPA and clients | typical request-response with blocking deps |
Raise boundedElastic limits | a property change | never as the end state |
| Hybrid: isolate the blocking part | move legacy calls behind an MVC service | one blocking dependency, rest non-blocking |
Going fully non-blocking means replacing JPA with R2DBC, which loses lazy loading, dirty checking and much of the mapping the team relies on, finding or building a non-blocking path for the SOAP service, and moving file I/O to an async API. That is a large cost, justified only if the load profile needs it.
Moving back to Spring MVC with virtual threads, enabled in Spring Boot 3.2 and later with spring.threads.virtual.enabled=true, gives each request a cheap virtual thread that may block freely. Blocking JPA, the SOAP client and file I/O all work in plain imperative code, debugging and stack traces become readable again, and concurrency can reach thousands of in-flight requests. For most CRUD and integration services this is the better fit.
4Deciding on Evidence, Not on Sunk Cost
I would run a load test that reproduces production traffic against both the current service and a small MVC prototype of its two busiest endpoints, and compare throughput, p99 latency and CPU at the same concurrency. If the MVC version with virtual threads matches or beats the reactive one, the decision is easy, and the months spent on the reactive version are not a reason to keep it; they are already spent either way. If the team has strong reactive skills and the roadmap includes streaming features, a gradual move to non-blocking drivers may still be right. Either way the decision includes team skill and on-call experience, because a model the team finds hard to debug costs time in every incident.
5Writing the Standard for Reactive Services
Finally, I would write down when a service should be reactive, so the next team does not repeat this. A service should be reactive only if its critical path is non-blocking end to end, or can be made so at reasonable cost, and it has a workload that benefits, such as streaming responses, long-lived connections, or thousands of concurrent calls to slow dependencies. Otherwise the default is MVC on virtual threads. Any blocking call in a reactive service must be listed in its design note with its dedicated scheduler, and BlockHound runs in its tests to catch new blocking calls on event loops.
6Follow-up questions
Couldn't we just use a larger boundedElastic pool?
It would recover some throughput by letting more blocking calls wait at once, but it keeps all the overhead of reactive operators and thread hops and all the debugging cost, while gaining none of the benefits. It is a reasonable short-term stopgap during an incident, not an architecture.
Are virtual threads always faster than reactive?
No. For CPU-bound work neither helps. For very high fan-out or streaming, reactive pipelines can still be more efficient and give built-in backpressure. Virtual threads win on simplicity for request-response services with blocking dependencies, which is the most common kind of service.
How do you bring the team along?
By sharing the measurements, not opinions: a short report showing where request time goes, the benchmark of both versions, and the cost of each option. Framing the decision as what the workload needs, rather than whether the earlier choice was a mistake, keeps people focused on the outcome.
7Conclusion
In this answer, we saw that wrapping every call in subscribeOn(boundedElastic) keeps the blocking model of MVC, often with a smaller pool, and adds operator overhead and thread hops, so worse throughput is expected. Reactive pays off only with non-blocking I/O end to end and high concurrency. We compared going fully non-blocking, moving back to MVC with virtual threads and isolating the blocking part, chose by benchmarking real load rather than by sunk cost, and wrote a standard so new services are reactive only when the workload and the stack support it.
Open with
What the team has is a blocking service wearing reactive clothes. Every request still waits on JPA, the SOAP client and file I/O, it just waits on a boundedElastic thread instead of a Tomcat thread.
Then, if they want more
And that pool is capped at ten times the cores, which might be 40 or 80 threads versus Tomcat's 200, plus every request now hops from the event loop to the pool and back several times and allocates operator objects. So being slower than MVC is expected.
Reactive only pays off when the I/O is non-blocking end to end, so a thread really can do other work while waiting, and when concurrency is high enough that waiting threads are the bottleneck. So I'd first measure: where does request time go, how many requests are in flight at peak, which calls block. Then there are two honest options.
Replace the blocking dependencies, JPA with R2DBC, a non-blocking path for SOAP, async file I/O, which is a lot of work and loses JPA features, and only makes sense for streaming or very high concurrency. Or move back to Spring MVC with virtual threads, where blocking is cheap and the code is simpler, which fits most CRUD and integration services.
I'd benchmark a small MVC prototype of the busiest endpoints against the current service and decide from that, plus team skill and on-call experience, not from the effort already spent. And I'd write a standard: reactive only when the stack is non-blocking and the workload needs it, otherwise MVC with virtual threads by default.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 3.2
- 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 Framework reference, Spring WebFlux, Project Reactor reference guide
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 team built a reactive service but wraps almost every call (JPA, a legacy SOAP client...": https://scrivio-interview-library.netlify.app/spring-boot/reactive-fundamentals/5134a7a269/