xuxueli / xxl-conf

A lightweight distributed configuration management platform. (分布式配置管理平台XXL-CONF)
http://www.xuxueli.com/xxl-conf/
GNU General Public License v3.0
666 stars 371 forks source link

How to resolve zookeeper miss events? #18

Closed PanFreyZheng closed 6 years ago

PanFreyZheng commented 6 years ago

我最近才开始接触zookeeper,项目上使用过程中因网络问题或多个服务访问同一个节点等原因.监听节点总是会有丢失.导致同步到数据库失败.请问这种情况应该怎么避免或优化呢?谢谢指教.

In the process of development, because of network delay, sometimes there will be no monitoring of znodes, how to avoid or optimize this situation?

xuxueli commented 6 years ago

你好,感谢关注啊! zk原生的Watch是一次性的,在监听到Watch时间时需要重复绑定,可以在Watch逻辑里做处理。 而且,ZK重连之后,也需要重新添加历史Watch。

如果你的需求场景是兼容zk节点,可以考虑接入 XXL-CONF 来实现功能啊?