-
Notifications
You must be signed in to change notification settings - Fork 311
5. 多数据源支持与覆盖
王宇轩 edited this page Oct 21, 2016
·
2 revisions
ZookeeperConfigProfile configProfile = new ZookeeperConfigProfile("zoo.host1:8181", "/projectx/modulex", "1.0.0");
GeneralConfigGroup propertyGroup1 = new ZookeeperConfigGroup(configProfile, "property-group1");
FileConfigProfile configProfile = new FileConfigProfile("UTF8", "properties");
ConfigGroup configGroup = new FileConfigGroup(configProfile, "classpath:property-group1.properties");
FileConfigProfile configProfile = new FileConfigProfile("UTF8", "xml");
ConfigGroup configGroup = new FileConfigGroup(configProfile, "classpath:property-group1.xml");
FileConfigProfile configProfile = new FileConfigProfile("UTF8", "properties");
ConfigGroup configGroup = new FileConfigGroup(configProfile, "file:/Users/yuxuanwang/Work/git/config-toolkit/config-toolkit-demo/src/main/resources/property-group1.properties");
FileConfigProfile configProfile = new FileConfigProfile("UTF8", "properties");
ConfigGroup configGroup = new FileConfigGroup(configProfile, "http://crnlmchina.github.io/config-group.properties");
不同的配置组之间可以任意互相覆盖.
[例]通过本地配置文件覆盖zookeeper配置:
ZookeeperConfigProfile configProfile = new ZookeeperConfigProfile("zoo.host1:8181", "/projectx/modulex", "1.0.0");
ConfigGroup zkConfigGroup = new ZookeeperConfigGroup(configProfile , "property-group1");
FileConfigProfile fileConfigProfile = new FileConfigProfile("UTF8", "properties");
ConfigGroup configGroup = new FileConfigGroup(zkConfigGroup, fileConfigProfile, "classpath:config-group1.properties");