对于reactive 技术栈,spring boot 提供了对应的servlet容器,包含Reactor Netty,tomcat, jetty,undertow,默认使用Reactor Netty,可以替换
starter 信息
spring-boot-starter-reactor-netty
spring-boot-starter-tomcat
spring-boot-starter-jetty
spring-boot-starter-undertow
maven 依赖配置如下
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- Exclude the Tomcat dependency -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>sspring-boot-starter-reactor-netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Use Jetty instead -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>