Grokking Spring Boot
0% completed
Virtual Threads
These two log lines come from the same POST /bookings request, in the same build of the booking service. Only one property differs between the two runs:
Handling request on Thread[#58,http-nio-8113-exec-2,5,main] Handling request on VirtualThread[#64,tomcat-handler-1]/runnable@ForkJoinPool-1-worker-1
The first request ran on one of Tomcat's pooled threads. The second ran on a virtual thread, which was at that moment running on a JDK worker thread called ForkJoinPool-1-worker-1. The code, the controller, and the response were identical.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%