Is there a Spring Boot configuration parameter to switch between virtual threads and platform threads?

1.1k views Asked by At

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?

1

There are 1 answers

2
M. Deinum On BEST ANSWER

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 to true in your application.properties.

Spring Boot will then automatically switch to virtual threads.