Search code examples
vaadinvaadin-flowvaadin10

Wait for Vaadin server startup


I've got a Vaadin 14 application (with Spring Boot) and want to do execute some code when the server is fully started and the frontend is compiled, up and running.

Putting the code into a @Component in the method afterPropertiesSet() does not work, because this is executed far before Vaadins frontend compilation.

Pulling for the login view (= http://localhost:8080/login returns a HTTP status equal to 200=OK) works, but this seems to be not the elegant way of doing this.

Question: what is the elegant way of waiting for Vaadin startup?


Solution

  • I would like to understand the usecase for this.

    because this is executed far before Vaadins frontend compilation

    Frontend compilation is done in runtime ONLY in dev mode which you should not use in the production environment. Dev mode is intended to be used to speed up the development and it's initially not elegant way of doing things (like extra process to start which is needed only once). If you Vaadin app in production then all the frontend resources should be pre-compiled using maven plugin. In the latter case Vaadin app is started as any other web application. So is it really necessary to wait for frontend compilation within the dev mode ?