Hazelcast: Execute EntryEvictedListener only once per cluster in client mode

久未见 提交于 2020-02-25 00:42:46

问题


We are connecting to Hazelcast cluster using Java clients from multiple nodes.

HazelcastClient.newHazelcastClient(cfg)

We need our EntryEvictedListener to be executed only once per cluster. By default it is executed on all connected clients.

Found how to reach this goal with Hazelcast embedded (Time Based Eviction in Hazelcast), but looks like

map.addLocalEntryListener(...) 

is not allowed for client.

So is there any way to execute eviction listener only once per cluster using client?


回答1:


Unfortunately not. You're listener would need to run on a cluster node, since the local is directly connected to the underlying partitioning scheme. What do you want to do on the evict event, maybe you can achieve it differently.



来源:https://stackoverflow.com/questions/47457364/hazelcast-execute-entryevictedlistener-only-once-per-cluster-in-client-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!