Bootstraphard3-5 years

Walk through what happens between SpringApplication.run() and the app accepting its first HTTP request.

SpringApplication.run() prepares the environment (property sources, profiles), creates the ApplicationContext, refreshes it — which instantiates and wires every singleton bean including a ServletWebServerFactory — and, as part of that refresh, the web server factory creates and starts an embedded Tomcat (or Jetty/Undertow) instance bound to the configured port. Only once that server is listening does the run complete and the app start accepting connections; readiness/liveness events fire around this point for anything that needs to know.

The lesson behind it →
More on Bootstrap