@chickenlj
就API层面而言,apollo确实是支持获取单个key和整个文件两种不同用法的,以适配不同的使用场景,比如对上面提到的案例:
1. 如果需要单独获取dubbo.consumer.timeout
``` java
ConfigService.getConfig("dubbo").getIntProperty("dubbo.consumer.timeout",
defaultTimeout);
//返回1000
```
2. 如果需要获取dubbo这个namespace所有的配置
```java
ConfigService.getConfigFile("dubbo", ConfigFileFormat.Properties).getContent();
//以properties格式返回所有配置
//dubbo.registry.address=zookeeper\://1.2.3.4\:2181
//dubbo.consumer.timeout=5000
```
[ Full content available at:
https://github.com/apache/incubator-dubbo/issues/3266 ]
This message was relayed via gitbox.apache.org for
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]