Search code examples
javaspring-mvcdistributed-cachinghazelcast

Hazelcast : shutting down a particular member from hazelcast cluster


I am using hazelcast with spring MVC and loading the instance with context. Now because of a bug in spring code sometimes my context gets reloaded.

And whenever spring context reloads hazelcast creates a new member in its cluster. I am working to solve the bug in spring but till than i wanted to know that how can i close particular member of hazelcast cluster without affecting rest of the members.

Thanks.


Solution

  • I have faced this problem recently. My only solution was to create a servlet context listener associated with spring servlet dispatcher and shutdown hazelcast instance on "contextDextroyed" event.

    Hope this helps.