This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 92f1a5cf18785b9ec45f890714563f629efe7a45
Author: ken.lj <[email protected]>
AuthorDate: Mon Nov 4 19:17:05 2019 +0800

    replace namespace suffix '.properties' with '-properties'
---
 .../dubbo/configcenter/support/apollo/ApolloDynamicConfiguration.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/dubbo-configcenter/dubbo-configcenter-apollo/src/main/java/org/apache/dubbo/configcenter/support/apollo/ApolloDynamicConfiguration.java
 
b/dubbo-configcenter/dubbo-configcenter-apollo/src/main/java/org/apache/dubbo/configcenter/support/apollo/ApolloDynamicConfiguration.java
index 67584ca..75970df 100644
--- 
a/dubbo-configcenter/dubbo-configcenter-apollo/src/main/java/org/apache/dubbo/configcenter/support/apollo/ApolloDynamicConfiguration.java
+++ 
b/dubbo-configcenter/dubbo-configcenter-apollo/src/main/java/org/apache/dubbo/configcenter/support/apollo/ApolloDynamicConfiguration.java
@@ -152,6 +152,10 @@ public class ApolloDynamicConfiguration implements 
DynamicConfiguration {
 
     @Override
     public String getProperties(String key, String group, long timeout) throws 
IllegalStateException {
+        // Apollo does not allow namespace ends with '.properties', '.yaml', 
...
+        if (key.endsWith(".properties")) {
+            key = key.replace(".properties", "-properties");
+        }
         ConfigFile configFile = ConfigService.getConfigFile(key, 
ConfigFileFormat.Properties);
         if (configFile == null) {
             throw new IllegalStateException("There is no namespace named " + 
key + " in Apollo.");

Reply via email to