多节点群集上的hazelcast条目​​侦听器

多节点群集上的hazelcast条目​​侦听器

本文介绍了多节点群集上的hazelcast条目​​侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多节点hazelcast群集.我需要确保在将新值插入到地图中时,仅调用一个entrylistener/地图存储.除非我脑部冻结,否则榛子广播默认不会这样做(如果我错了,那就太好了).除了使用分布式锁(我不希望避免在其他节点上使用侦听器/映射存储)之外,还有其他建议可确保只有一个侦听器/映射存储最终执行代码.

I have a multi-node hazelcast cluster. I need to ensure that when a new value is inserted into a map, only one entrylistener/map store gets invoked. Unless I am having a brain freeze, hazelcast does not do that by default (It would be great if I was wrong about this). Besides using distributed locks (I do not wish to avoid using listeners/map stores on other nodes), are there any other suggestions to ensure that only one listener/map store ends up executing code.

谢谢

推荐答案

在放置权之后,只有节点拥有密钥,才会执行地图存储操作.放置后,只有将自己添加为地图的侦听器的对象才会接收事件.

After a put only the node owns the key executes the map store operation.After a put only the ones which have added itself as listener to a map will receive event.

这篇关于多节点群集上的hazelcast条目​​侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 12:57