I have written tcp server using spring integration. Thanks to excellent sample https://github.com/spring-projects/spring-integration-samples/tree/master/basic/tcp-client-server Sample server stops if the user pressed q on the console.
TCP Server is a stand alone application and runs perfectly fine accepting requests and sending responses. I would like to add orderly shutdown of the server because Console access is not possible if the server is started as a background process.
is there a way for the server to wait for events? If the shutdown event comes then I can call applicationContext.stop().
I would appreciate if you can suggest any ideas on orderly shutdown process.
Thanks