0

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.

Anuj Patel
  • 17,261
  • 3
  • 30
  • 57

2 Answers2

2

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.

fmgp
  • 1,638
  • 17
  • 17
1

All you need to do is get a shutdown hook created when the context initialized and call shutdown method (read manual for that) when context exits.