Is there a standard built-in Spring Boot configuration parameter to tell whether to use virtual threads or platform threads for rest controller?
Or is the only way to create configuration beans, like described e.g. here https://www.baeldung.com/spring-6-virtual-threads?
For the current supported Spring Boot versions (at the moment that is up to Spring Boot 3.1) doing manual configuration is the only way.
As of Spring Boot 3.2 it is a matter of enabling it in your configuration by setting
spring.threads.virtual.enabled
totrue
in yourapplication.properties
.Spring Boot will then automatically switch to virtual threads.