spring RestTemplate 出现 NoHttpResponseException 和 ConnectionTimeoutException
使用 httpclient.4.5.6 springboot 2.0.8RELEASE RetryExec.java CloseableHttpResponse execute() try { return this.requestExecutor.execute(route, request, context, execAware); } catch(final IOException ex) { if (retryHandler.retryRequest(ex.execCount, context) { } else { if (ex instanceof NoHttpResponseException) { } } } @Configuration public class RestTemplateConfig { // builder.build();的并发量是5,不如 new RestTemplate() 默认200 @Bean public RestTemplate restTemplate(RestTemplateBuilder builder) { return builder.build(); } } 这样建的RestTemplate 没有重发 NoHttpResponseException和org.apache.http.conn