I am trying to get discovery first mode working with Spring cloud Eureka. My spring boot version is 3.1.0. Here are the settings in application.properties
spring.cloud.config.discovery.enabled=true spring.cloud.config.discovery.serviceId=configserver spring.cloud.config.fail-fast=true spring.cloud.config.retry.initialInterval=3000 spring.cloud.config.retry.multiplier=1.3 spring.cloud.config.retry.maxInterval=10000 spring.cloud.config.retry.maxAttempts=20
eureka.client.serviceUrl.defaultZone=http://sd-1:8080/eureka eureka.instance.metadata-map.configPath=/config
The config server is registered and I see an entry for it on the Eureka server. However on startup the application fails with the following error
APPLICATION FAILED TO START
Description:
No spring.config.import property has been defined
Action:
Add a spring.config.import=configserver: property to your configuration. If configuration is not required add spring.config.import=optional:configserver: instead. To disable this check, set spring.cloud.config.enabled=false or spring.cloud.config.import-check.enabled=false.
I checked the documentation at https://docs.spring.io/spring-cloud-config/docs/3.0.3/reference/html/#config-first-bootstrap and don't seem to be missing anything. Any thoughts why the config server is not being discovered?
Comment From: ryanjbaxter
See this comment and see if it helps https://github.com/spring-cloud/spring-cloud-config/issues/2295#issuecomment-1600847647
Comment From: dharshanrg
Worked. Thanks again for the quick input.