-
Notifications
You must be signed in to change notification settings - Fork 307
2. Quick Start
Haruhi edited this page Oct 9, 2017
·
10 revisions
<dependency>
<groupId>com.dangdang</groupId>
<artifactId>config-toolkit</artifactId>
<version>3.1.6-RELEASE</version>
</dependency>ZookeeperConfigProfile configProfile = new ZookeeperConfigProfile("zoo.host1:8181,zoo.host2:8181,zoo.host3:8181", "/projectx/modulex", "1.0.0");
GeneralConfigGroup propertyGroup1 = new ZookeeperConfigGroup(configProfile, "property-group1");
String stringProperty = propertyGroup1.get("string_property_key");
Preconditions.checkState("Config-Toolkit".equals(stringProperty));
String intProperty = propertyGroup1.get("int_property_key");
Preconditions.checkState(1123 == Integer.parseInt(intProperty));- config-toolkit-demo工程中有丰富的代码示例
- 运行示例前请先运行InitialScript