问题描述:

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.

网友答案:

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.

网友答案:

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.

相关阅读:
Top