According to the MDN, HTTP 503 Service Unavailable server error means :
... response code indicates
that the server is not ready to handle the request.
The common causes are :
a server that is down for maintenance or that is overloaded.
To reproduce this error response in a natural way, you could so overloaded Tomcat.
To do it change the maximum number of simultaneous requests that can be handled by Tomcat.
If you use an embedded tomcat, set the server.tomcat.max-threads
Spring Boot property with a weak value easily reachable such as :
server.tomcat.max-threads = 1
Otherwise, if you use our own Tomcat installation, set maxThreads
with a weak value in the Connector
element of the server.xml
configuration file :
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
...
maxThreads="1"/>