ReplicatedMap.get makes remote call?

Skip to first unread message

Niels Ull Harremoës

Nov 24, 2021, 11:29:24 AM11/24/21
to Hazelcast

Sorry for repeating a question I also asked on Stack overflow, but I did not get a relevant answer?

We are using a ReplicatedMap in a Hazelcast client. Client and server are both version 4.2.1.

The map is quite small (<10 entries, each value less than 100 bytes). The client only reads from the map, which is updated infrequently on the server.

We expected ReplicatedMap.get to be non-blocking, but during a long running performance test, we started getting warnings like the one below from vertx (which monitors for blocked threads). The first error came after 6 hours, so it is not easily reproduced.

Is there any way to do a non-blocking get? Or do we need to add an EntryListener, which maintains a local ConcurrentHashmap?

Clarification: The real issue here is not blocking vertx (which can be solved by moving the call to a Vertx worker verticle), but rather avoiding delaying the lookup. The business requirement is that we process messages in 50 ms or less, so even if we moved the call to a worker, we would be unable to fulfill that.

[vertx-blocked-thread-checker] WARN io.vertx.core.impl.BlockedThreadChecker - Thread Thread[vert.x-eventloop-thread-0,5,main] has been blocked for 12777 ms, time limit is 2000 ms io.vertx.core.VertxException: Thread blocked at jdk.internal.misc.Unsafe.park(Native Method) ~[?:?] at java.util.concurrent.locks.LockSupport.park( ~[?:?] at com.hazelcast.spi.impl.AbstractInvocationFuture.manageParking( ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.spi.impl.AbstractInvocationFuture.get( ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.client.impl.spi.ClientProxy.invokeOnPartition( ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.client.impl.spi.ClientProxy.invoke( ~[hazelcast-4.2.1.jar!/:4.2.1] at com.hazelcast.client.impl.proxy.ClientReplicatedMapProxy.get( ~[hazelcast-4.2.1.jar!/:4.2.1] at my.package.StateGetter.getState( ~[classes!/:1.5.189]

Vassilis Bekiaris

Nov 25, 2021, 3:28:15 AM11/25/21
to Hazelcast
Hi Niels,

I think that what you are looking for is to configure near cache ( on your client. ReplicatedMap entries are replicated across all members of the cluster, but clients still need to perform a remote call to a member to get a value. With near cache, your client will cache entries locally and invalidate as needed.

This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast

Nov 25, 2021, 7:12:50 AM11/25/21

Thank you very much - I had apparently not realised the difference between lcients and members for ReplicatedMaps.

Regards, Niels

You received this message because you are subscribed to a topic in the Google Groups "Hazelcast" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages