Lock lock = hazelcastInstance.getLock( "myLock" );
lock.lock();
try {
// do something here
} finally {
lock.unlock();
}--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/8db44feb-e26d-4f18-93ec-6310e7c8bc23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
private final ConcurrentMap<String, CountDownLatch> latches = new ConcurrentHashMap<>();
public void replicateMap(String name) {
try {
// TODO: Replicate the map here
} finally {
// Whatever happens count down the latch so that it doesn't cause a deadlock in case of errors.
latches.computeIfAbsent(name, k -> new CountDownLatch(1)).countDown();
}
}
public IMap getMap(String name) {
try {
latches.computeIfAbsent(name, k -> new CountDownLatch(1)).await();
} catch (InterruptedException ignored) {
}
return hazelcastInstance.getIMap(name);
}http://member_ip:port/hazelcast/rest/mancenter/wan/sync/allmaps. I have 3 microservices which are using these hazelcast maps to validate the data.--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/a6144f3f-3f2a-409b-adbe-02962607bf32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"valli"
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/f2a22b77-a890-4e65-87a1-abb8920ae0e6%40googlegroups.com.