Expand my Community achievements bar.

SOLVED

Read timeout Apache HttpClient

Avatar

Level 4

Hi Team, I am currently using 5s as socket timeout in apache http client. I would like to increase this timeout to 10s as my api is taking more than 5s to respond. If we increase timeout would there be any problem in the background? What is the max timeout seconds we can configure for better performance?

 

CloseableHttpClient httpClient = clientBuilderFactory.newBuilder()
                .setDefaultRequestConfig(RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build())
                .build(); CloseableHttpResponse response = httpClient.execute(httpGet)

 

Thanks.

 

@aanchal_sikka 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
1 Reply

Avatar

Correct answer by
Community Advisor