Session
When Virtual Threads Aren't Enough: Coroutines in Spring Boot
Virtual threads have transformed the game. With Spring Boot 4, you can get reactive-level performance using simple, blocking code. WebFlux is no longer required. So why should you still care about coroutines?
Because virtual threads solve the concurrency problem, not the composition problem. When you need to combine multiple async data sources, stream results in real time, or apply backpressure, coroutines and flows remain the most expressive tool on the JVM.
In this workshop, you'll learn when virtual threads are enough and when coroutines give you something virtual threads can't. You'll build a reactive API in Spring Boot from scratch and learn how to:
- Use virtual threads as the default for simple request/response services.
- Switch to coroutines when you need structured concurrency, parallel decomposition, or flow-based streaming.
- Make non-blocking remote API calls with WebClient.
- Access a relational database with the reactive R2DBC driver.
- Create an advanced streaming API based on Server-Sent Events that combines coroutines and flows.
- Write and test reactive API endpoints.
By the end of the workshop, you'll know when to reach for virtual threads, when to reach for coroutines, and how they complement each other in Spring Boot 4. No more choosing between simplicity and power. You'll know how to use both.
Previously delivered at KotlinConf 2024 and Spring I/O 2024. Fully updated for Spring Boot 4 and Java 25+.
Preferred duration: full day (6 hours).
Participants need a laptop with JDK 25+, IntelliJ IDEA, and Docker. All exercises are provided as a prepared code repository.
Technical requirements: projector, flip chart appreciated.
Jeroen Rosenberg
Dev of the Ops - Continuous Deliverer - Principal Consultant @ FreshMinds
Amsterdam, The Netherlands
Links
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top