Book-Microservices-v3 / chapter08c

Learn Microservices with Spring Boot 3 (3rd edition) - Chapter 8 - 3/4
1 stars 1 forks source link

consul kv store data is not able to read #1

Open bryanxtong opened 2 months ago

bryanxtong commented 2 months ago

I read this book and try to run this example and found this example didnot work with current consul kv store setting(gateway is working) except I move the following contents from bootstrap to application.properties for gamification and multiplication

spring.cloud.consul.config.prefixes=config spring.cloud.consul.config.format=yaml spring.cloud.consul.config.default-context=defaults spring.cloud.consul.config.data-key=application.yml

There is another way to add spring-cloud-starter-bootstrap dependency in pom which will load bootstrap.properties and It seems the default mechanism doesnot load bootstrap.properties if we are not using spring-cloud-starter-bootstrap, please correct me if I am wrong .

ravikart commented 2 months ago

Thanks bryanxtong, I was also facing the same issue. Link to support your findings: https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/#spring-cloud-consul-discovery