Shutdown Spring Integration's async pub-sub channel threads immediately when container receives a SIG_TERM

47 views Asked by At

I am facing an issue where my spring integration project is trying to sftp something, but when the PaaS needs to restart my container, I need to stop everything, do some cleanup tasks quickly and let it dies.

So I would need to already-executing pub-sub async channel thread to stop immediately (the sftp task) so it won't cause racing condition with the SmartLifeCycle's stop(). I wonder if there is anyway I can achieve this?

Thanks!

0

There are 0 answers