EvilJinious1
EvilJinious1

Reputation: 2863

Starting a spring cloud service when consul is not available

We have a number of services that are using consul for discovery. We recently switched from Eureka.

If consul is not running then the services fail to start. It is possible to use a similar mechanism that the consul config uses for failFast so it does not fail to start.

So basically, if consul is not available then it logs an error and continues. Mostly this is for unit testing concerns.

Upvotes: 1

Views: 2733

Answers (1)

spencergibb
spencergibb

Reputation: 25157

2 things: There is an open issue to support failFast=false for discovery and you can disable consul discovery entirely for testing spring.cloud.consul.discovery.enabled=false or put @EnableDiscoveryClient on a configuration class that is controled by a profile.

Upvotes: 2

Related Questions