Kirill
Kirill

Reputation: 21

Hazelcast: Execute EntryEvictedListener only once per cluster in client mode

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?

Upvotes: 2

Views: 855

Answers (1)

noctarius
noctarius

Reputation: 6094

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.

Upvotes: 1

Related Questions