From 635f8f16a6c43562e3419759c11f1486c83c6553 Mon Sep 17 00:00:00 2001 From: srchen1987 Date: Wed, 16 Jun 2021 20:24:41 +0800 Subject: [PATCH 1/2] Update ConfigWatch.java optimize performance --- .../org/springframework/cloud/consul/config/ConfigWatch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java index d28636dc3..38c82b4c3 100644 --- a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java +++ b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java @@ -154,8 +154,8 @@ public void watchConfigKeyValues() { aclToken = null; } - Response> response = this.consul.getKVValues(context, aclToken, - new QueryParams(this.properties.getWatch().getWaitTime(), currentIndex)); + Response> response = this.consul.getKVKeysOnly(context, this.properties.getProfileSeparator(), aclToken + ,new QueryParams(this.properties.getWatch().getWaitTime(), currentIndex)); // if response.value == null, response was a 404, otherwise it was a // 200, reducing churn if there wasn't anything From 1d2e7a678d83b1c6e514c99f3d541ada6d6c6b2e Mon Sep 17 00:00:00 2001 From: srchen1987 Date: Wed, 16 Jun 2021 20:55:19 +0800 Subject: [PATCH 2/2] Update ConfigWatch.java --- .../org/springframework/cloud/consul/config/ConfigWatch.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java index 38c82b4c3..df658209d 100644 --- a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java +++ b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConfigWatch.java @@ -25,7 +25,6 @@ import com.ecwid.consul.v1.ConsulClient; import com.ecwid.consul.v1.QueryParams; import com.ecwid.consul.v1.Response; -import com.ecwid.consul.v1.kv.model.GetValue; import io.micrometer.core.annotation.Timed; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;