Johnca
Johnca

Reputation: 143

Hazelcast - confused on where to configure the near cache

i have a hazelcast client that connects to a hazelcast cluster. For one specific map it is very important for the client to have its own copy since it is accessed very frequently and is a read-mostly one. So this map must be a near cache, and also it must be invalidated on change. I'm confused because i can add the near-cache tag on both the cluster-side hazelcast.xml and the client side hazelcast-client.xml. For now I've added the tag on both configurations:

In hazelcast-client.xml:

<near-cache>
    <name>umsGameBanDistributedMap</name>
    <invalidate-on-change>true</invalidate-on-change>
</near-cache>

And in hazelcast.xml (cluster side):

<map name="umsGameBanDistributedMap">
    <near-cache>
        <invalidate-on-change>true</invalidate-on-change>
    </near-cache>
</map>

But i can't figure out if i'm doing well.

Thank you for you help.

Upvotes: 3

Views: 1269

Answers (1)

ali
ali

Reputation: 886

You don't have to add the near-cache config to cluster side just add to client.xml in order to cache entries locally in client.

Upvotes: 3

Related Questions