summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java2
-rw-r--r--holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java2
-rw-r--r--holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java2
3 files changed, 4 insertions, 2 deletions
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java b/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java
index 9c6ab3c..c17ad4a 100644
--- a/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java
+++ b/holmes-actions/src/main/java/org/openo/holmes/common/config/MicroServiceConfig.java
@@ -28,7 +28,7 @@ public class MicroServiceConfig {
}
public static String getMsbServerAddr() {
- return getProperty("MSB_ADDR") + ":" + AlarmConst.MICRO_SERVICE_PORT;
+ return AlarmConst.HTTP+getProperty("MSB_ADDR") + ":" + AlarmConst.MICRO_SERVICE_PORT;
}
public static String getServiceIp() {
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java b/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
index 40e15eb..9e83d4c 100644
--- a/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
+++ b/holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
@@ -36,4 +36,6 @@ public interface AlarmConst {
int MICRO_SERVICE_STATUS_SUCCESS = 201;
int MICRO_SERVICE_PORT = 8086;
+
+ String HTTP = "http://";
}
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java b/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java
index 5e806e4..9f66178 100644
--- a/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java
+++ b/holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java
@@ -40,7 +40,7 @@ public class MSBRegisterUtil {
try {
ObjectMapper mapper = new ObjectMapper();
String content = mapper.writeValueAsString(entity);
- HttpPost httpPost = new HttpPost("http://" + MicroServiceConfig.getMsbServerAddr()
+ HttpPost httpPost = new HttpPost(MicroServiceConfig.getMsbServerAddr()
+ "/api/microservices/v1/services?createOrUpdate=false");
if (StringUtils.isNotEmpty(content)) {
httpPost.setEntity(new ByteArrayEntity(content.getBytes()));