Quick revision
The short answer
Virtual threads need Spring Boot 3.2 or later on Java 21 or later, and preferably JDK 24 or later, such as Java 25 LTS, so that synchronized blocks no longer pin threads. So the first year is mostly prerequisites: move the Boot 2 services to Boot 3, which also means the javax to jakarta namespace migration, move everyone to Java 25, and update observability for the new thread dump format, JFR pinning events and downstream saturation metrics. The second year enables virtual threads service by service behind configuration, I/O-bound services first, each with load tests and explicit concurrency limits, while progress and incidents are tracked centrally and the plan adjusts to what we learn.
What to remember
In this answer, we planned the sequencing around prerequisites: Spring Boot 3.2 or later and Java 21 or later, with Java 25 preferred so synchronized no longer pins. Boot 3 services move to Java 25 first, Boot 2 services go through the Boot 3 and jakarta migration, and observability is updated for the new thread dumps, JFR pinning events and downstream saturation metrics. Virtual threads are then enabled service by service behind configuration, I/O-bound services first, with load tests and explicit limits, while central tracking of progress and incidents lets the plan adapt.
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.
Virtual threads need Spring Boot 3.2 or later on Java 21 or later, and preferably JDK 24 or later, such as Java 25 LTS, so that synchronized blocks no longer pin threads. So the first year is mostly prerequisites: move the Boot 2 services to Boot 3, which also means the javax to jakarta namespace migration, move everyone to Java 25, and update observability for the new thread dump format, JFR pinning events and downstream saturation metrics. The second year enables virtual threads service by service behind configuration, I/O-bound services first, each with load tests and explicit concurrency limits, while progress and incidents are tracked centrally and the plan adjusts to what we learn.
Why this question is asked
A two-year plan for 200 services is not a technical question about virtual threads; it is a question about sequencing dependencies, spreading risk and learning early. The feature itself is one property, but the path to being able to use it safely runs through framework upgrades, JDK upgrades and operational changes that each have their own cost. Interviewers ask this to see whether we can find the critical path and avoid a big-bang rollout. In this answer, we will set out the prerequisites, sort the fleet into waves, plan the observability work, design the per-service rollout and decide how to track and adapt the plan.
1A Quick Recap of the Prerequisites
The property spring.threads.virtual.enabled exists from Spring Boot 3.2, and virtual threads are final from Java 21. But on JDK 21 to 23, a virtual thread that blocks inside a synchronized block or method stays pinned to its carrier thread, one of the few platform threads that run virtual threads, so a library that does I/O under synchronized can exhaust the carriers and stall the service. JDK 24 (JEP 491) removed that pinning for synchronized. So the practical target is Java 25, the current LTS release, with Spring Boot 3.5 or later.
Our fleet is on Java 17, some on Boot 2 and some on Boot 3. Boot 3 already requires Java 17, so the Boot 3 services are one JDK upgrade and one minor Boot upgrade away. The Boot 2 services have the longest path: Boot 3 moved from the javax.* to the jakarta.* package names for servlet, persistence and validation APIs, which touches imports, libraries and sometimes configuration across the whole code base.
2Sorting the Fleet Into Waves
The first month is an inventory, generated rather than collected by hand: for each service, its Boot version, JDK, main dependencies, whether it is I/O-bound or CPU-bound, its traffic and its owning team. Let us say it shows 120 services on Boot 3 and 80 on Boot 2. From that we build waves that each have one goal.
| Period | Wave | Goal |
|---|---|---|
| Months 1-2 | Inventory and platform | Versions, owners, I/O vs CPU, shared parent build on Java 25 |
| Months 2-9 | 120 Boot 3 services | Java 25, Boot 3.5+; enable observability |
| Months 3-15 | 80 Boot 2 services | Boot 3 and jakarta migration, then Java 25 |
| Months 6-9 | 5 pilot services | First virtual-thread enablement with load tests |
| Months 9-24 | Remaining I/O-bound services | Enable per service behind configuration |
| Ongoing | CPU-bound services | Stay on platform threads; no change needed |
Notice that the virtual-threads work starts only when a service is on the target stack, but the waves overlap: early services can enable virtual threads in year one while the Boot 2 migration is still running elsewhere. That gives us real findings early, which is the point of the next sections.
3Making the Prerequisite Upgrades Cheap
Upgrading 200 services is only feasible if each upgrade is boring. A shared parent build (a Maven parent or Gradle convention plugin) fixes the JDK, the Boot version and common dependency versions in one place, so moving a service is mostly a version bump plus test fixes. For the jakarta migration, automated recipes, such as OpenRewrite's Spring Boot 3 migration, do most of the mechanical renaming, and the hard part is third-party libraries that never published a jakarta version. Those are the risks to find in the inventory: each one either gets an upgrade, a replacement or an exception with an owner.
The JDK upgrade from 17 to 25 also has its own checklist, such as removed APIs, stricter encapsulation of JDK internals and changed garbage collector defaults. It is worth doing in a service that has nothing else changing at the same time, so that any regression has one cause.
4Updating Observability First
Virtual threads change how incidents look, so operations must be ready before the first service flips. Thread dumps from jstack show platform threads but not unmounted virtual threads; the new format from jcmd Thread.dump_to_file, as plain text or JSON, includes them. Runbooks and tooling that parse thread dumps need updating. Java Flight Recorder records jdk.VirtualThreadPinned when a virtual thread blocks while pinned, which on Java 25 mostly means native code. And we need saturation metrics for every downstream resource: pending connections in Hikari, queue time in HTTP client pools, and rejection counts on our own semaphores. Thread pool utilisation used to be the early warning that a service was overloaded; with virtual threads there is no such pool, so the warning has to come from the resources behind it.
5Enabling Virtual Threads Service by Service
Each service follows the same steps, and the change is always a configuration flag so it can be reversed in minutes without a deploy.
- On Java 25 and Boot 3.5+?YesContinueNoBack to the upgrade waves
- I/O-bound workload?YesContinueNoKeep platform threads
- Add explicit limitssemaphores per scarce resource, pool sized from the database
- Load test with the flag on and offcompare latency, errors, pending connections
- Enable on one instance (canary)
spring.threads.virtual.enabled=true via config - Saturation and pinning stable for a week?YesEnable on all instancesNoTurn the flag off and investigate
6 steps in order. Play them, or step through them one at a time.
The reason we start with I/O-bound services is that they gain the most: request handlers that spend most of their time waiting on databases and HTTP calls. CPU-bound services such as image or report rendering gain nothing and are left alone. The explicit limits matter because, as we saw with connection pools, removing the thread pool removes a hidden cap on every downstream call.
6Tracking Progress and Adapting the Plan
A central dashboard, generated from the build metadata, shows each service's Boot version, JDK and whether the flag is on, so progress is visible without status meetings. Every incident that involves virtual threads gets a short write-up in one shared place, and a small platform group reviews them monthly. If the pilots show, say, that a common HTTP client library pins carriers or that a shared ThreadLocal cache bloats memory, we fix it once in the platform, update the checklist, and adjust the order of the remaining waves.
I would also budget for the plan to change. If a third of the Boot 2 services turn out to be retired within a year, we stop migrating them. If pilots show no measurable gain for a class of service, enabling virtual threads there becomes optional rather than mandatory. Success at the end of two years is all services on a supported stack, and virtual threads enabled wherever they reduced cost or incidents, not necessarily everywhere.
7Follow-up questions
Why not enable virtual threads on Java 21 to save a year?
We can for services whose libraries do not do blocking I/O inside synchronized, and some teams will. But on Java 21 the pinning risk depends on every library's internals, which is hard to audit across 200 services. Targeting Java 25 removes that class of problem and lands everyone on the current LTS release anyway, so the extra wait buys a lot of safety.
Which risks would you put at the top of the risk register?
Libraries without jakarta versions blocking the Boot 3 migration, hidden concurrency limits disappearing and overloading databases, ThreadLocal-heavy libraries using much more memory with many threads, monitoring that cannot see virtual threads, and the teams' capacity, since this competes with product work. Each one gets an owner and a mitigation.
How do you keep 200 teams from each reinventing the steps?
By providing the steps as platform defaults: the parent build, the migration recipes, a starter that adds standard limits and metrics, and a written checklist with the load test template. Teams then only handle what is specific to their service, which is what makes two years realistic.
8Conclusion
In this answer, we planned the sequencing around prerequisites: Spring Boot 3.2 or later and Java 21 or later, with Java 25 preferred so synchronized no longer pins. Boot 3 services move to Java 25 first, Boot 2 services go through the Boot 3 and jakarta migration, and observability is updated for the new thread dumps, JFR pinning events and downstream saturation metrics. Virtual threads are then enabled service by service behind configuration, I/O-bound services first, with load tests and explicit limits, while central tracking of progress and incidents lets the plan adapt.
Open with
I would split the two years into prerequisites and enablement, overlapping. The prerequisites are Spring Boot 3.2 or later and Java 21 or later, and I would target Java 25 LTS because from JDK 24 synchronized no longer pins virtual threads to carriers, which removes a risk I cannot audit across 200 services.
Then, if they want more
First I would generate an inventory: versions, owners, and whether each service is I/O-bound. The Boot 3 services move to Java 25 and a current Boot 3.5 through a shared parent build, so each upgrade is mostly a version bump.
The Boot 2 services are the long pole: Boot 3 means the javax to jakarta migration, which I would automate with OpenRewrite recipes, and the real risk is libraries without jakarta versions.
Before any service flips the flag, I would update observability: the new jcmd thread dump format, JFR pinning events, and saturation metrics for connection pools and downstream calls, since thread pool usage no longer warns us.
Then each service enables virtual threads behind configuration, I/O-bound ones first, starting with a few pilots: explicit concurrency limits, a load test with the flag on and off, a canary, then everywhere. CPU-bound services stay as they are. Progress and incidents are tracked centrally, and I would adjust the waves based on what the pilots teach us.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 25, Java 21, Spring Boot 3.2, Java 17
- 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
- JEP 444, Virtual Threads
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 "You have 200 Spring Boot services on Java 17, some on Boot 2 and some on Boot 3. Plan...": https://scrivio-interview-library.netlify.app/java/virtual-threads/f20ba43f7b/