首页 > 百科知识 正文

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

时间:2023-11-20 03:56:02 阅读:174 作者:卜小心


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


本章目标

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

操作步骤

添加依赖

引入 Spring Boot Starter 父工程

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

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

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

验证结果

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

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

源码地址

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

总结

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

版权声明:该问答观点仅代表作者本人。如有侵犯您版权权利请告知 cpumjj@hotmail.com,我们将尽快删除相关内容。