Spring RestTemplate Connection Timeout is not working
I am trying to configure time out when external web service call. I am calling external web service by Spring Rest Template in my service. For connection timeout testing purpose, the external web service is stopped and application server is down. I have configured 10 seconds for timeout, but unfortunately i get connection refused exception after a second. try { final RestTemplate restTemplate = new RestTemplate(); ((org.springframework.http.client.SimpleClientHttpRequestFactory) restTemplate.getRequestFactory()).setReadTimeout(1000*10); ((org.springframework.http.client