public class ZooKeeperProcessRegistry extends Object implements ProcessRegistry
ProcessRegistry implementation reading properties from the ZooKeeper
nodes.
curator-framework jar is present in the classpath, ZooKeeperProcessRegistry will be created.
ZooKeeperProcessRegistry attempts to read properties values from the ZooKeeper server.
localhost:2181 (2181 is the default port used by the
Fabric8 to start ZooKeeper on). If you would like to change it, set fabric8.process.registry.zk.hosts
system property to the customized list of hosts:
java -Dfabric8.process.registry.zk.hosts=host1:5555,host2:6666 -jar my-service.jar
foo.bar property
will be resolved as the foo/bar ZNode path.
@Value("${foo.bar}") // try to read foo/bar ZNode from the ZooKeeper
String bar;
| Constructor and Description |
|---|
ZooKeeperProcessRegistry(String hosts) |
| Modifier and Type | Method and Description |
|---|---|
static ZooKeeperProcessRegistry |
autodetectZooKeeperProcessRegistry() |
protected String |
convertPropertiesKeyToPath(String key) |
String |
hosts() |
String |
readProperty(String key)
Reads property from the process registry.
|
public ZooKeeperProcessRegistry(String hosts)
public static ZooKeeperProcessRegistry autodetectZooKeeperProcessRegistry()
public String hosts()
public String readProperty(String key)
ProcessRegistryreadProperty in interface ProcessRegistrykey - identifies uniquely property to be resolved.null if property is not availableCopyright © 2011–2014 Red Hat. All rights reserved.