X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Faai%2FAaiQuery.java;h=a13c6274fa150b4c960e6106e2f3025298521e7a;hb=3356fb82b20ebe7209522e4e009dd6aea5ed1802;hp=b3f3f3a16695e9db4d4ed74d88cd982503e2627d;hpb=77a032f176183287746858d8eb57a6062286d327;p=holmes%2Fcommon.git diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java b/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java index b3f3f3a..a13c627 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/aai/AaiQuery.java @@ -20,6 +20,8 @@ import java.util.Map; import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.impl.client.CloseableHttpClient; import org.jvnet.hk2.annotations.Service; import org.onap.holmes.common.aai.config.AaiConfig; @@ -142,13 +144,15 @@ public class AaiQuery { private String getResponse(String url) throws CorrelationException { String response; CloseableHttpClient httpClient = null; + HttpGet httpGet = new HttpGet(url); try { httpClient = HttpsUtils.getHttpClient(HttpsUtils.DEFUALT_TIMEOUT); - HttpResponse httpResponse = HttpsUtils.get(url, getHeaders(), httpClient); + HttpResponse httpResponse = HttpsUtils.get(httpGet, getHeaders(), httpClient); response = HttpsUtils.extractResponseEntity(httpResponse); } catch (Exception e) { throw new CorrelationException("Failed to get data from aai", e); } finally { + httpGet.releaseConnection(); if (httpClient != null) { try { httpClient.close();