1 year ago
#316279
AP_22
8080 gets closed immediately after sending SIGINT signal to tomcat
I am hosting an application in Tomcat. I have some cleanup logic that needs to run before application shuts down, which I have implemented using spring @Predestroy methods. After I send SIGINT to the process, predestroyer logic starts running, which is exactly what I want. But as part of this predestroy logic, there are a few API calls and other stuff that needs 8080 to be still open. As soon as I send kill signal, the ports are closed, but the process still runs. Is there a way I can still keep the ports open until all beans are destroyed? Can someone please help?
( I have used graceful shutdown tag with a sufficient timeout period, it does not work for me even though the prerequisites are met - https://dzone.com/articles/configuring-graceful-shutdown-readiness-and-livene My spring boot version is 2.6 and tomcat is 9.0.60 )
java
spring-boot
tomcat9
graceful-shutdown
0 Answers
Your Answer