大部分文章都提到以下两个配置spring.mvc.async.request-timeout和server.tomcat.connection-timeout,实测不能达到效果。
考虑spring/tomcat本身是否有相关配置,翻阅了官方文档和源码,理解如下:
对于同步接口,暂时没有(没找到)超时时间配置。
对于异步接口,有超时时间配置(具体往下看spring.mvc.async.request-timeout)。
下方列了两个大部分文章都提到的配置项描述、使用方式,以及其他超时时间配置方法:
server.tomcat.connection-timeout
Amount of time the connector will wait, after accepting a connection, for the request URI line to be presented.
server.tomcat.connection-timeout是建立连接需要的时间,非连接处理的时间
spring.mvc.async.request-timeout
Amount of time before asynchronous request handling times out. If this value is not set, the default timeout of the underlying implementation is used.
spring.mvc.async.request-timeout 异步请求的时间,搭配Callable使用



