Fix micro service status code
authoryoubowu <wu.youbo@zte.com.cn>
Thu, 9 Mar 2017 10:22:20 +0000 (18:22 +0800)
committer6092002067 <wu.youbo@zte.com.cn>
Thu, 9 Mar 2017 10:22:20 +0000 (18:22 +0800)
Issue-ID:HOLMES-50

Change-Id: Ibdee9acf13c85d554a50e9c758941c9025776a04
Signed-off-by: youbowu <wu.youbo@zte.com.cn>
holmes-actions/src/main/java/org/openo/holmes/common/constant/AlarmConst.java
holmes-actions/src/main/java/org/openo/holmes/common/utils/MSBRegisterUtil.java

index 2ddf78f..3894bf3 100644 (file)
@@ -33,5 +33,5 @@ public interface AlarmConst {
 \r
     String ADMIN = "admin";\r
 \r
-    int RESPONSE_STATUS_OK = 200;\r
+    int MICRO_SERVICE_STATUS_SUCCESS = 201;\r
 }\r
index 30e411f..826fbd0 100644 (file)
@@ -53,14 +53,13 @@ public class MSBRegisterUtil {
                 log.warn("Registering the service to the bus failure", e);\r
                 return false;\r
             }\r
-            if (response.getStatusLine().getStatusCode() == AlarmConst.RESPONSE_STATUS_OK) {\r
+            if (response.getStatusLine().getStatusCode() == AlarmConst.MICRO_SERVICE_STATUS_SUCCESS) {\r
                 log.info("Registration successful service to the bus :" + response.getEntity());\r
                 return true;\r
             } else {\r
                 log.warn(\r
                         "Registering the service to the bus failure:" + response.getStatusLine().getStatusCode() + " " +\r
-                                response.getStatusLine().getReasonPhrase() + response.getStatusLine()\r
-                                .getProtocolVersion());\r
+                                response.getStatusLine().getReasonPhrase());\r
                 return false;\r
             }\r
         } finally {\r