0

I need to launch a process after the embedded Tomcat and every REST service are fully operational.

Is ApplicationReadyEvent thrown after Tomcat is launched, and every single webapp and REST service is fully deployed? Or is there a better/later event I should use?


I scoured the internet and the closest discussion I could find is Running Code After Spring Boot Starts, although it does not delve into the REST service readiness matter and I could not simply ask for clarification in the best answer (not enough reputation yet).

Simply testing isn't going to help since I plan to add quite a few large REST services over time which will stretch startup times so I could succeed now and fail later.

  • Spring Boot Actuator /health endpoint returns `"UP"` if everything is ready. This is what loadbalancers usually use to figure out if a node is ready to serve requests. – Tarmo Mar 13 '23 at 14:23
  • What do you need to launch? And no that event will not fire for multiple applications. Each application (spring boot) will fire this event. – M. Deinum Mar 13 '23 at 14:59

1 Answers1

0

If you have a single Spring Boot Application and you can add your code inside it then ApplicationReadyEvent is the right one for your requirements.

Mar-Z
  • 2,660
  • 2
  • 4
  • 16