How to make Spring Boot application resilient to database connection errors?
I want a Spring Boot application to be resilient to database connection errors. If the application starts before the database is available, it should try to establish a connection to the database. The same should happen if the connection to the database is lost during operation (e.g. database restart, network error ...). And I am using Flyway migration so that Flyway shouldn't start (and throw an exception) until a database connection is available.
How can I do this with Spring Boot (1.5)?
+3
source to share
1 answer
There is an open ticket for this behavior / issue in spring boot tracking https://github.com/spring-projects/spring-boot/issues/4779
+1
source to share