Can 'undertow' be enhanced by virtual threads in 'spring-boot 3.2'?

997 views Asked by At

Very happy, spring-boot 3.2 is released.

In Spring Boot 3.2.0 Release Notes

enter image description here

As mentioned here, spring-boot can enable virtual threads. And tomcat and jetty can handle web requests using virtual threads.

However, there is no mention of undertow.

Can undertow be enhanced by virtual threads?

Maybe, undertow's IO model is fast (IO+WORKER). Virtual threads are not necessary. I don't really understand.

1

There are 1 answers

2
Sergey On

It is planned for Spring Boot 3.3.0, but you can also enable it using the following approach:

@Bean
public UndertowDeploymentInfoCustomizer undertowDeploymentInfoCustomizer() {
    return deploymentInfo -> deploymentInfo.setExecutor(Executors.newVirtualThreadPerTaskExecutor());
}

There is a discussion about it here.