Spring Cloud Eureka with Config Server Spring Cloud Eureka with Config Server spring spring

Spring Cloud Eureka with Config Server


The default way to use Eureka and Config Server is to use Config First bootstrap. Essentially, you make eureka server a client of the config server but you don't make the config server a client of eureka.

As said by David Syer on these (and this) issues, the founder of spring cloud, you have to use the config server with a front end load balancer, so a single URL is already highly available.

I'm also a newbie in Spring Cloud but I agree with him since Eureka is a Service Discovery, IMHO it should function on it's problem domain only. It would make a complicated logic for Eureka servers who are asking the Config servers for it's configuration. I can't imagine how the Eureka Server would know which config server to get if the Config Server is also the Server of Eureka to get its list of defaultZone.

It would be much more simpler for me to separate the Config Server's HA.


Based on @Mideel's answer

Eureka and Config Client configuration (needs to be Bootstrap):

# bootstrap.ymlcloud:    config:      discovery:        enabled: true # This is required        service-id: configserver # Config Server's eureka registry name      enabled: true # This is default true already

Config Server configuration:

spring:  application:    name: configserver # Needs to match client configuration

Register the Config Server with the annotation @EnableEurekaClient (it should be Auto Configured to register with Eureka already though)


The Spring Cloud Config service provides configuration info for various other microservices, of which the Eureka service is one.

Each app/microservice is pointed to its configuration (from the Config service) via bootstrap.properties/.yml, which is loaded in the parent context for that application, before the app "recognizes" that it is a discovery/Eureka client per its annotated main class. This bit of documentation provides a bit more detail on that process.

Cheers,Mark