java - How to stop Embedded Tomcat gracefully and tomcat should get stopped only after the current processing requests have to complete -


we have implemented embedded tomcat model java application. , running war file java -jar command. problem how can stop server. , before server getting stopped, fired requests server should processed. have stop server. how can implement this. in advance.

make application when finished write file /somedir/yoursecretfile

if using linux, make cron job check periodically if file /somedir/yoursecretfile exist , if file exists, stops web server (maybe ps | grep | xargs or that).

if using other os, use replacement cron os , script stops webserver.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -