Unexpected notice for zk data change
https://github.com/spring-cloud/spring-cloud-zookeeper/blob/b0e12877120771cb1f223c4c69234a25758b07a9/spring-cloud-zookeeper-config/src/main/java/org/springframework/cloud/zookeeper/config/ConfigWatcher.java#L116C4-L117C72
Though data has bean created or modified for a long time before application start ,curator still publish a event about node create.Ignoring event whose modify time is out of date may be a good way.
public void childEvent(CuratorFramework client, TreeCacheEvent event)
throws Exception {
TreeCacheEvent.Type eventType = event.getType();
if (eventType != NODE_ADDED && eventType != NODE_REMOVED
&& eventType != NODE_UPDATED) {
return;
}
// ignore event whose modify time is out of date
String path = event.getData().getPath();
long validTime = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(1);
if (eventType == NODE_ADDED
&& event.getData().getStat().getMtime() < validTime) {
return;
}
this.publisher.publishEvent(new RefreshEvent(this, event, getEventDesc(event)));
}
@spencergibb @OlgaMaciaszek
Obviously, we don't control notifications from curator. What problem is this causing?
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Obviously, we don't control notifications from curator. What problem is this causing?
It's not nessary to listen data which has bean created or modified for a long time before application start.
PRs welcome
fix in #337
PRs welcome
@spencergibb I have raised a pr for 3 weeks, should someone cr?