Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I issue a shut down command on Tomcat does it process all messages in progress using Spring Integration

We've been having a discussion at work about shutting down tomcat when doing processing with Spring Integration.

We are wondering if Spring (Spring Integration), by default, processes all messages in progress on an inbound channel before it says to Tomcat it's ready to shut down?

My hunch is the Spring container would free all available resources, including blocking processing anything new onto a channel, before it told Tomcat it was ready to shut down. Only an idea though and I need to do a good bit of research. Is there something we have to add to make sure shutdown occurs best using Tomcat?

Research: So far looks like something like 'fire and forget' exists on outbound channel adapter so inbound channels probably include the same sort of thing.

like image 515
Crowie Avatar asked Feb 03 '26 09:02

Crowie


1 Answers

You can also use the destroy-method="cleanUp" for spring bean. You can clean all your resource from this method before destroying the bean.

like image 102
Ashish Chaurasia Avatar answered Feb 04 '26 21:02

Ashish Chaurasia