diff options
author | 6092002067 <wu.youbo@zte.com.cn> | 2017-03-13 19:22:08 +0800 |
---|---|---|
committer | 6092002067 <wu.youbo@zte.com.cn> | 2017-03-13 19:36:44 +0800 |
commit | 4f4eb055ff1e6d7f35315f0b742e2505ea025549 (patch) | |
tree | 703dc5b2a9b8721ded80cb3c49ea2c128247dd02 /rulemgt/src | |
parent | 927cc01381a3db932834ed2d1e9343a177616fac (diff) |
Add log for debugging
Issue-ID: HOLMES-50
Change-Id: I3a481f36be640c7b6e067c3663d422d39aae588c
Signed-off-by: youbowu <wu.youbo@zte.com.cn>
Diffstat (limited to 'rulemgt/src')
-rw-r--r-- | rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java | 10 | ||||
-rw-r--r-- | rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java b/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java index e792fbf..ac381d1 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java +++ b/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java @@ -26,7 +26,6 @@ import javax.ws.rs.core.Response; import lombok.extern.slf4j.Slf4j;
import org.glassfish.jersey.client.ClientConfig;
import org.jvnet.hk2.annotations.Service;
-import org.openo.holmes.common.config.MicroServiceConfig;
import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;
import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;
import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
@@ -35,10 +34,11 @@ import org.openo.holmes.rulemgt.constant.RuleMgtConstant; @Service
public class EngineService {
+ String url = "http://10.250.0.3:9102";
+
protected Response delete(String packageName) throws IOException {
Client client = createClient();
- WebTarget webTarget = client
- .target(MicroServiceConfig.getMsbServerAddr() + RuleMgtConstant.ENGINE_PATH + "/" + packageName);
+ WebTarget webTarget = client.target(url + RuleMgtConstant.ENGINE_PATH + "/" + packageName);
return webTarget.request(MediaType.APPLICATION_JSON).delete();
}
@@ -52,7 +52,7 @@ public class EngineService { Client client = createClient();
ObjectMapper mapper = new ObjectMapper();
String content = mapper.writeValueAsString(correlationCheckRule4Engine);
- WebTarget webTarget = client.target(MicroServiceConfig.getMsbServerAddr() + RuleMgtConstant.ENGINE_PATH);
+ WebTarget webTarget = client.target(url + RuleMgtConstant.ENGINE_PATH);
return webTarget.request(MediaType.APPLICATION_JSON).post(Entity.entity(content, MediaType.APPLICATION_JSON));
}
@@ -60,7 +60,7 @@ public class EngineService { Client client = createClient();
ObjectMapper mapper = new ObjectMapper();
String content = mapper.writeValueAsString(correlationDeployRule4Engine);
- WebTarget webTarget = client.target(MicroServiceConfig.getMsbServerAddr() + RuleMgtConstant.ENGINE_PATH);
+ WebTarget webTarget = client.target(url + RuleMgtConstant.ENGINE_PATH);
return webTarget.request(MediaType.APPLICATION_JSON).put(Entity.entity(content, MediaType.APPLICATION_JSON));
}
}
diff --git a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java b/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java index c568723..cdae89e 100644 --- a/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java +++ b/rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java @@ -81,6 +81,7 @@ public class EngineWrapper { log.info("Call check rule rest interface in engine successfully.");
return true;
} else {
+ log.info(response.getStatus() + " " + response.getStatusInfo() + " " + response.getEntity());
throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CHECK_NO_PASS);
}
}
|