3 回答

TA贡献1804条经验 获得超8个赞
server.connection-timeout= #
连接器在关闭连接之前等待另一个 HTTP 请求的时间。如果未设置,则使用连接器的特定于容器的默认值。
Use a value of -1 to indicate no (that is, an infinite) timeout. (might be bad fix)
或 尝试从应用程序设置它
@SpringBootApplication
public class Application {
public static void main(String[] args) throws Exception {
System.setProperty("server.port","8080"));
System.setProperty("server.connection-timeout","300000");
System.setProperty("server.tomcat.max-threads","yourValue"); //in-case if you want to chaneg number of thredas
SpringApplication.run(Application.class, args);
}
}
另外,请参阅此

TA贡献1828条经验 获得超3个赞
试试这个
@Bean public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) { return restTemplateBuilder .setConnectTimeout(...) .setReadTimeout(...) .build(); }
添加回答
举报