在使用curator的监听器时,控制台定期反馈debug信息,算正常么?
09:38:31,901 DEBUG ClientCnxn:717 - Got ping response for sessionid: 0x374e86c14060004 after 0ms
09:38:45,236 DEBUG ClientCnxn:717 - Got ping response for sessionid: 0x374e86c14060004 after 1ms
09:38:58,570 DEBUG ClientCnxn:717 - Got ping response for sessionid: 0x374e86c14060004 after 0ms
而且为什么比如我在用pathchildrennode时程序无错误运行,但是我在xshell上做一些对节点的操作它不回馈呢,我应该也配置好了呀
String connStr = "demo03:2181,demo04:2181,demo05:2181";
RetryPolicy retryPolicy = new RetryNTimes(3, 3000);
CuratorFramework zkClient = CuratorFrameworkFactory.newClient(connStr, retryPolicy);
String path = "/test01";
PathChildrenCache pathChildrenCache = new PathChildrenCache(zkClient, path, true);
我也自己定义了系统提示了
@Override
public void childEvent(CuratorFramework client, PathChildrenCacheEvent pathChildrenCacheEvent) throws Exception {
System.out.println("一级子节点改变.."+pathChildrenCacheEvent.getData()+ pathChildrenCacheEvent.getType());
求大神指教