Skip to main content

Hazelcast : Auto Reconnect to Hazelcast Server

Points To Remember

You can call the method getLifecycleService().isRunning() to check if the hazelcast clinet is up and running.

Auto Reconnect to Hazelcast Server

You can use the following code to reconnect to Hazelcast server, in case the hazelcast client looses the connection to the hazelcast server.
if(!(hazelcastInstance!=null && hazelcastInstance.getLifecycleService().isRunning())){
// create a new hazelcast connection
}
return hazelcast instance

Comments