summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java
diff options
context:
space:
mode:
authorShiwei Tian <tian.shiwei@zte.com.cn>2018-04-16 17:01:34 +0800
committerShiwei Tian <tian.shiwei@zte.com.cn>2018-04-16 17:01:34 +0800
commit57d0392cd069569f8797fded20a6406f5e6f156f (patch)
treea835a1eb1224cc3d1caaeaa7d023973be648a859 /rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java
parent37b3bb9b015069ba5e9ad1845de30467decb61d4 (diff)
fix https timeout get connection
Issue-ID: HOLMES-104 Change-Id: Ib235d4df9a221bbf2d2f0322aac73f9ca894bfbe Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
Diffstat (limited to 'rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java
index 992785f..9b30705 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineIpList.java
@@ -19,6 +19,7 @@ package org.onap.holmes.rulemgt.msb;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.jvnet.hk2.annotations.Service;
import org.onap.holmes.common.api.entity.ServiceEntity;
@@ -52,14 +53,16 @@ public class EngineIpList {
public List<String> getServiceCount()throws Exception{
String response;
CloseableHttpClient httpClient = null;
+ HttpGet httpGet = new HttpGet(url);
try {
httpClient = HttpsUtils.getHttpClient(HttpsUtils.DEFUALT_TIMEOUT);
HttpResponse httpResponse = HttpsUtils
- .get(url, new HashMap<>(), httpClient);
+ .get(httpGet, new HashMap<>(), httpClient);
response = HttpsUtils.extractResponseEntity(httpResponse);
} catch (Exception e) {
throw e;
} finally {
+ httpGet.releaseConnection();
if (httpClient != null) {
try {
httpClient.close();