Virtual threads in Spring Boot
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
turn them on and measure.
Planned topics
- Requires a JDK with virtual threads and a Spring Boot version that supports them (verify version before recording).
- Enable with
spring.threads.virtual.enabled=true; request handling and async executors then use virtual threads. - Existing blocking code (JDBC,
RestClient) stays as is. - Measure with a load test before and after; do not assume.
ThreadLocalstill works but is costly with millions of threads; prefer explicit passing.
Draft outline details
Demonstration
spring:
threads:
virtual:
enabled: trueCheck your understanding
What changes in your controller code?
Show answer
Nothing; the same blocking code runs on virtual threads.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.