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?
It's very easy - here is the code:
HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
instance.getLifecycleService().shutdown();
That is correct.
Depending on the Hazelcast version, you can also call hazelcastInstance.shutdown()
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With