You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2020/05/08 00:47:41 UTC
[servicecomb-java-chassis] branch master updated: [SCB-1861] toke
the revision when pull from kie
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 7e68121 [SCB-1861] toke the revision when pull from kie
7e68121 is described below
commit 7e68121d40f49a6d32ee3ca2c8ec4814201b4fe7
Author: GuoYL <gy...@gmail.com>
AuthorDate: Thu Apr 9 17:24:42 2020 +0800
[SCB-1861] toke the revision when pull from kie
---
.../java/org/apache/servicecomb/config/kie/client/KieClient.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieClient.java b/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieClient.java
index 362a90d..e130bee 100644
--- a/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieClient.java
+++ b/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieClient.java
@@ -57,6 +57,8 @@ public class KieClient {
private static final int LONG_POLLING_WAIT_TIME_IN_SECONDS = 30;
+ private static String revision = "0";
+
private static final KieConfig KIE_CONFIG = KieConfig.INSTANCE;
private final int refreshInterval = KIE_CONFIG.getRefreshInterval();
@@ -115,8 +117,8 @@ public class KieClient {
String path = "/v1/"
+ KieConfig.INSTANCE.getDomainName()
+ "/kie/kv?label=app:"
- + KieConfig.INSTANCE.getAppName();
-
+ + KieConfig.INSTANCE.getAppName()
+ + "&revision=" + revision;
long timeout;
if (enableLongPolling && !IS_FIRST_PULL.get()) {
path += "&wait=" + LONG_POLLING_WAIT_TIME_IN_SECONDS + "s";
@@ -131,6 +133,7 @@ public class KieClient {
HttpClientRequest request = client
.get(ipPort.getPort(), ipPort.getHostOrIp(), finalPath, rsp -> {
if (rsp.statusCode() == HttpStatus.SC_OK) {
+ revision = rsp.getHeader("X-Kie-Revision");
rsp.bodyHandler(buf -> {
try {
Map<String, Object> resMap = KieUtil.getConfigByLabel(JsonUtils.OBJ_MAPPER