Spring rest template readTimeOut
问题 I'm trying to understand the readTimeout available on restTemplate, what is it exactly ? Is it the the total amount of time the request can take before we get the timeout exception ? 回答1: You can define a read timeout on a RestTemplate as follows: HttpComponentsClientHttpRequestFactory clientRequestFactory = new HttpComponentsClientHttpRequestFactory(); // set the read timeot, this value is in miliseconds clientRequestFactory.setReadTimeout(500); RestTemplate restTemplate = new RestTemplate