替换 SpringBoot 的启动服务器 Tomcat 服务器为 Undertow 服务器
操作步骤添加依赖
引入 Spring Boot Starter 父工程
在引入 spring-boot-starter-web 依赖时,剔除出对 tomcat 的依赖,然后再添加对 undertow 的依赖用于替换 tomcat。
验证结果
启动项目,查看启动日志,可以看到如下两行
源码地址
本章源码 : https://gitee.com/gongm_24/spring-boot-tutorial.git
总结Undertow 是一个比 Tomcat 性能更好的服务器,这是一个优化项。