springboot 性能调试(SpringBoot2.0实战6配置Undertow服务器)(1)


本章目标

替换 SpringBoot 的启动服务器 Tomcat 服务器为 Undertow 服务器

操作步骤

添加依赖

引入 Spring Boot Starter 父工程

springboot 性能调试(SpringBoot2.0实战6配置Undertow服务器)(2)

在引入 spring-boot-starter-web 依赖时,剔除出对 tomcat 的依赖,然后再添加对 undertow 的依赖用于替换 tomcat。

springboot 性能调试(SpringBoot2.0实战6配置Undertow服务器)(3)

验证结果

启动项目,查看启动日志,可以看到如下两行

springboot 性能调试(SpringBoot2.0实战6配置Undertow服务器)(4)

源码地址

本章源码 : https://gitee.com/gongm_24/spring-boot-tutorial.git

总结

Undertow 是一个比 Tomcat 性能更好的服务器,这是一个优化项。

,