From 3acb36c6d3e91f6b99830ea17ef05193c25bef65 Mon Sep 17 00:00:00 2001 From: karthik-tarento Date: Thu, 30 Jun 2022 09:30:43 +0530 Subject: [PATCH] Increased REST request timeout to 45 seconds --- .../org/sunbird/portal/SbCbExtApplication.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/sunbird/portal/SbCbExtApplication.java b/src/main/java/org/sunbird/portal/SbCbExtApplication.java index 43a60dea5..170d7e488 100644 --- a/src/main/java/org/sunbird/portal/SbCbExtApplication.java +++ b/src/main/java/org/sunbird/portal/SbCbExtApplication.java @@ -36,14 +36,13 @@ public RestTemplate restTemplate() throws Exception { } private ClientHttpRequestFactory getClientHttpRequestFactory() { - - int timeout = 30000; - RequestConfig config = RequestConfig.custom().setConnectTimeout(timeout).setConnectionRequestTimeout(timeout) - .setSocketTimeout(timeout).build(); - CloseableHttpClient client = HttpClientBuilder.create().setMaxConnTotal(2000).setMaxConnPerRoute(500) - .setDefaultRequestConfig(config).build(); - HttpComponentsClientHttpRequestFactory cRequestFactory = new HttpComponentsClientHttpRequestFactory(client); - cRequestFactory.setReadTimeout(timeout); - return cRequestFactory; + int timeout = 45000; + RequestConfig config = RequestConfig.custom().setConnectTimeout(timeout).setConnectionRequestTimeout(timeout) + .setSocketTimeout(timeout).build(); + CloseableHttpClient client = HttpClientBuilder.create().setMaxConnTotal(2000).setMaxConnPerRoute(500) + .setDefaultRequestConfig(config).build(); + HttpComponentsClientHttpRequestFactory cRequestFactory = new HttpComponentsClientHttpRequestFactory(client); + cRequestFactory.setReadTimeout(timeout); + return cRequestFactory; } }