You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot 3升级报错:server.connection-timeout属性替代方案咨询

Spring Boot 3 中 server.connection-timeout 的替代属性

Spring Boot 3 移除了通用的server.connection-timeout配置项,原因是不同嵌入式服务器(Tomcat、Jetty、Undertow)的连接超时实现逻辑存在差异,需使用各服务器专属的配置属性:

  • Tomcat:使用server.tomcat.connection-timeout,单位默认毫秒

    server:
      tomcat:
        connection-timeout: 30000
    
  • Jetty:使用server.jetty.idle-timeout,该配置控制连接空闲超时,与原属性功能一致

    server:
      jetty:
        idle-timeout: 30000
    
  • Undertow:使用server.undertow.socket-timeout,配置套接字超时

    server:
      undertow:
        socket-timeout: 30000
    

若项目未指定嵌入式服务器,Spring Boot 默认使用 Tomcat,直接配置server.tomcat.connection-timeout即可。

内容的提问来源于stack exchange,提问作者Ayesha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 13:30:12