0
votes

I have multiple application servers on my classpath, namely Netty via spring-boot-starter-webflux and Tomcat through another dependency chain. How can I determine which application server to use in Spring Boot?

Currently, Tomcat is being started instead Netty.

Important note: I can't exclude any of them, Tomcat is used by CXF, Netty is used by WebClient.

2

2 Answers

0
votes

Just use proper spring-boot-starter-package

https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html

In your case it will be probably spring-boot-starter-reactor-netty

Also it would be wise to exclude multiple JEE embedded containers and remove those you don't need.

0
votes

You can specify the application is reactive directly in you configuration at startup something like this

@Configuration
@EnableAutoConfiguration
public class Application {
    public static void main(final String[] args) {
        final SpringApplication springApplication = new SpringApplication(Application.class);
        springApplication.setWebApplicationType(WebApplicationType.REACTIVE);
        springApplication.run(args);
    }
}