I'm trying to make my spring boot application start without connection to the db. The approach in this question seems to be very promising, however, my application executes a CommandLineRunner
which does some db maintainance (verifying that all indices are in place etc.) on startup. In order to avoid getting timeouts there, I tried to run the CommandLineRunner
method asynchronously (using Spring's @Async
), trying to get a db connection until it succeeds, but I'm still getting timeout exceptions. I assume that async execution of the CommandLineRunner
method doesn't work.
Any hints on this?