X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Fconfig%2FMicroServiceConfig.java;h=212bc663b7699c56455a3833b1348246c6f911b0;hb=3dfe506a8ea1bec7096da63541e426958d04a1a0;hp=01a5f2e6818fc67b02f262627e25b2997407d8d2;hpb=2e3aee44bf7a25aa665c3e6bd1130209ace50193;p=holmes%2Fcommon.git diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java b/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java index 01a5f2e..212bc66 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/config/MicroServiceConfig.java @@ -49,6 +49,7 @@ public class MicroServiceConfig { public static String getConfigBindingServiceAddrInfo() { String ret = null; String queryString = getConsulAddrInfo() + CONFIG_BINDING_SERVICE; + log.info("Query the CBS address using the URL: " + queryString); try { JSONObject addrJson = (JSONObject) JSONArray.fromObject(execQuery(queryString)).get(0); if (addrJson.has("ServiceAddress") && addrJson.has("ServicePort")) { @@ -57,6 +58,7 @@ public class MicroServiceConfig { } catch (Exception e) { log.warn(e.getMessage(), e); } + log.info("The CBS address is " + ret); return ret; } @@ -71,6 +73,7 @@ public class MicroServiceConfig { String url = getConfigBindingServiceAddrInfo() + "/service_component/" +serviceName; try { JSONObject jsonObject = JSONObject.fromObject(execQuery(url)); + log.info("The origin configurations (" + url + ") returned by DCAE is: " + jsonObject.toString()); if (jsonObject.has(serviceName)) { ret = (String) jsonObject.getJSONArray(serviceName).get(0); } @@ -92,7 +95,11 @@ public class MicroServiceConfig { public static String[] getMsbAddrInfo() { String[] msbServerInfo = null; - String info = getServiceAddrInfoFromCBS(MSB_ADDR); + //String info = getServiceAddrInfoFromCBS(MSB_ADDR); + String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME)); + log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + "."); + JSONObject infoObj = JSONObject.fromObject(info); + info = infoObj.has("msb.hostname") ? infoObj.getString("msb.hostname") : null; if (info != null){ msbServerInfo = split(info); } else { @@ -105,6 +112,7 @@ public class MicroServiceConfig { public static String[] getServiceAddrInfo() { String[] serviceAddrInfo = null; String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME)); + log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + "."); if (info != null){ serviceAddrInfo = split(info); } else {