Philipp Claßen Philipp Claßen - 7 months ago 54
Java Question

Fail fast if a Spring application cannot connect to its config server

Consider you have a Spring application that gets its configuration from a config server. If it cannot connect to the config server, the application will continue to start but as all configurations are missing, it will eventually fail with a potentially misleading error.

Is it possible to configure Spring, so it immediately aborts when it cannot connect to its config server during startup?


Set to true in your bootstrap.yml or file.

From the documentation

Config Client Fail Fast

In some cases, it may be desirable to fail startup of a service if it cannot connect to the Config Server. If this is the desired behavior, set the bootstrap configuration property and the client will halt with an Exception.