From 71904f241cd3047054dc0a36c04120a3f53205ae Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Tue, 13 Feb 2018 10:38:16 +0200 Subject: Plugin pubsub implementation Added implementation for sdc-hub and plugin pubsub classes Added timeout in the plugin head request health check Passing parentUrl in query params to each plugin Change-Id: Ie94aa4b398dd2fcfdf2d134f6c5785d3aa50d237 Issue-ID: SDC-1007 Signed-off-by: Idan Amit --- .../src/main/java/org/openecomp/sdc/fe/impl/PluginStatusBL.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'catalog-fe/src/main') diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/PluginStatusBL.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/PluginStatusBL.java index a369d661fc..563dc22507 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/PluginStatusBL.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/PluginStatusBL.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpHead; import org.apache.http.impl.client.CloseableHttpClient; @@ -60,6 +61,12 @@ public class PluginStatusBL { boolean result = false; HttpHead head = new HttpHead(plugin.getPluginDiscoveryUrl()); + RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(1000) + .setConnectTimeout(1000) + .setConnectionRequestTimeout(1000).build(); + + head.setConfig(requestConfig); try (CloseableHttpResponse response = this.client.execute(head)) { result = response != null && response.getStatusLine().getStatusCode() == 200; -- cgit 1.2.3-korg