0

2023-06-01 16:16:35,868 [Thread-6] INFO....

2023-06-01 16:16:44,989 [Thread-6 ] ERROR....

Error:- "<URL>": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out

Its not even waiting 600000 millisecond but throwing error within 10 second (16:16:35 --- 16:16:44)

'org.springframework.boot' version '2.7.8'your text 'org.apache.httpcomponents:httpclient:4.3.4'

Its not even waiting 600000 millisecond but throwing error within 10 second (16:16:35 --- 16:16:44)

I have configured below

@Configuration `public class MyConfig {

@Bean
public RestTemplate restTemplate() {
    HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
    factory.setConnectTimeout(600000);
    factory.setReadTimeout(600000);
    RestTemplate restTemplate = new RestTemplate(factory);
    return restTemplate;
}

} `

Rest Call:- 
try { responseString = restTemplate.postForObject(new URI(URL), requestEntity, String.class); } catch (Exception e) { throw new MyException("500", e.getMessage()); }

0 Answers0