i have spring boot application can shut down anytime manually user. application pushes data messaging queue read file. want call method should persist state upto the file read if application shut down.
you can use spring boot shutdown hook logic yourself.
application exit
each springapplication register shutdown hook jvm ensure applicationcontext closed gracefully on exit. standard spring lifecycle callbacks (such disposablebean interface, or @predestroy annotation) can used.
in addition, beans may implement org.springframework.boot.exitcodegenerator interface if wish return specific exit code when application ends.
Comments
Post a Comment