3

I have a sprig boot app leveraging websockets using tomcat. The app is writing stuff to the database constantly, and now I would like to implement a proper shutdown procedures i.e. I have found a way to tell in my Service Layer to wait until all database transactions has finished however I would like to tell tomcat during that time that he shell not accept new connection i.e. only process the the currently established one. Tomcat should run but all new sessions should be denied.

I can get all the currently logged in users trough the “SessionRegistry” bean and invalidate their sessions, once all database transactions has finished, but that does not prevent anyone form creating new session during that time. So my question is how to I tell tomcat to stop accepting new session but not to drop the currently created one and let them finish. Is there something like that build in into tomcat?

Addition : 15 March 2018

I think i found the answer look
here

Hope that this will be useful for someone

Tito
  • 2,234
  • 6
  • 31
  • 65

0 Answers0