This is an automated email from the ASF dual-hosted git repository. tswstarplanet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push: new 5230444 fix publish null value when use consul config center (#6351) 5230444 is described below commit 5230444d5f83e586ce759d15e02ee799cf6241e7 Author: tswstarplanet <tswstarpla...@apache.org> AuthorDate: Sun Jun 21 00:12:40 2020 +0800 fix publish null value when use consul config center (#6351) * fix publish null value when use consul config center --- .../dubbo/configcenter/consul/ConsulDynamicConfiguration.java | 2 +- .../dubbo/configcenter/consul/ConsulDynamicConfigurationTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dubbo-configcenter/dubbo-configcenter-consul/src/main/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfiguration.java b/dubbo-configcenter/dubbo-configcenter-consul/src/main/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfiguration.java index 282bdef..e0e9a86 100644 --- a/dubbo-configcenter/dubbo-configcenter-consul/src/main/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfiguration.java +++ b/dubbo-configcenter/dubbo-configcenter-consul/src/main/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfiguration.java @@ -145,7 +145,7 @@ public class ConsulDynamicConfiguration implements DynamicConfiguration { // } // return true; String normalizedKey = convertKey(group, key); - return kvClient.putValue(normalizedKey + PATH_SEPARATOR + content); + return kvClient.putValue(normalizedKey, content); } @Override diff --git a/dubbo-configcenter/dubbo-configcenter-consul/src/test/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfigurationTest.java b/dubbo-configcenter/dubbo-configcenter-consul/src/test/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfigurationTest.java index 8ada5fb..d924c83 100644 --- a/dubbo-configcenter/dubbo-configcenter-consul/src/test/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfigurationTest.java +++ b/dubbo-configcenter/dubbo-configcenter-consul/src/test/java/org/apache/dubbo/configcenter/consul/ConsulDynamicConfigurationTest.java @@ -103,6 +103,12 @@ public class ConsulDynamicConfigurationTest { } @Test + public void testPublishConfig() { + configuration.publishConfig("foo", "value1"); + Assertions.assertEquals("value1", configuration.getString("/dubbo/config/dubbo/foo")); + } + + @Test public void testGetConfigKeys() { }