Winston Winston - 3 months ago 15
Java Question

Is there any way to shut down a Hazelcast instance in a JVM?

My Java code started numbers of Hazelcast instances in the same JVM (but they are in the same group).

Now I want to shut down some of instances, but not all of them.

I know the method

Hazelcast.shutdownAll()
- this method closes all of the instances. Is there a method that allows to close a specific instance?

Answer

It's very easy - here is the code:

HazelcastInstance instance =  Hazelcast.newHazelcastInstance(config);

instance.getLifecycleService().shutdown();
Comments