java zookeeper读取节点
import ;
import ;
import ;
import ;
import ;
import ;
public class ZKTest {
public static void main(String[] args) {
String connectString = "127.0.0.1:2181";
int sessionTimeout = 4000;
Watcher watcher = new Watcher() {
public void process(WatchedEvent event) {
//(());
}
};
try {
ZooKeeper zooKeeper = new ZooKeeper(connectString, sessionTimeout, watcher);
List<String> list = ("/dubbo", false);
for (String path : list) {
(path);
}
} catch (IOException e) {
();
} catch (KeeperException e) {
();
} catch (InterruptedException e) {
();
}
}
}