1

Is there a way in Tomcat 8 to set the HTTP 503 response on a port for maintenance purposes?

What I am trying to do is to notify a load balancer that Tomcat is under maintenance and after the work on the application inside Tomcat is completed set the HTTP response back to 200.

Thanks

user1982350
  • 2,441
  • 2
  • 14
  • 11
  • You mean when your Tomcat is down? Then you would need an another process to bind the port and send the 503 response. Anyway, most of the load balancers are smart enough to handle the situation, when the port is closed. Or what exactly is your use case? – Jozef Chocholacek Nov 17 '16 at 08:05
  • Thanks Jozef. I found a workaround. I ve written an HttpServlet that answers 200 to a GET if the application inside Tomcat is healthy. When we want to do some maintenance we set the response to 503 and the load balancer stops sending request to it. Thanks – user1982350 Nov 27 '16 at 22:13

0 Answers0