From 5eec3c5ec841aaca0a64e10028197a47ed2acbc6 Mon Sep 17 00:00:00 2001 From: vasraz Date: Thu, 24 Feb 2022 09:17:07 +0000 Subject: Increase FE timout Change-Id: Id25eb2931119404a90a48ee7a50b286c975a6f82 Signed-off-by: Vasyl Razinkov Issue-ID: SDC-3886 --- .../org/openecomp/sdc/fe/servlets/SSLProxyServlet.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'catalog-fe/src/main/java') diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java index e74893f714..891bc4ae34 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java @@ -33,8 +33,7 @@ import org.slf4j.LoggerFactory; public abstract class SSLProxyServlet extends ProxyServlet { private static final long serialVersionUID = 1L; - private static final int TIMEOUT = 600000; - private static Logger log = LoggerFactory.getLogger(SSLProxyServlet.class.getName()); + private static final Logger log = LoggerFactory.getLogger(SSLProxyServlet.class); @Override protected HttpClient createHttpClient() throws ServletException { @@ -42,17 +41,19 @@ public abstract class SSLProxyServlet extends ProxyServlet { .getConfiguration(); boolean isSecureClient = !config.getBeProtocol().equals(BeProtocol.HTTP.getProtocolName()); HttpClient client = (isSecureClient) ? getSecureHttpClient() : super.createHttpClient(); - setTimeout(TIMEOUT); - client.setIdleTimeout(TIMEOUT); - client.setStopTimeout(TIMEOUT); + int requestTimeout = config.getRequestTimeout() * 1000; + if (requestTimeout == 0) { + requestTimeout = 1200_000; + } + setTimeout(requestTimeout); + client.setIdleTimeout(requestTimeout); + client.setStopTimeout(requestTimeout); return client; } private HttpClient getSecureHttpClient() throws ServletException { - // Instantiate and configure the SslContextFactory - SslContextFactory sslContextFactory = new SslContextFactory(true); // Instantiate HttpClient with the SslContextFactory - HttpClient httpClient = new HttpClient(sslContextFactory); + final var httpClient = new HttpClient(new SslContextFactory.Client(true)); // Configure HttpClient, for example: httpClient.setFollowRedirects(false); // Start HttpClient -- cgit 1.2.3-korg