spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
813 stars 541 forks source link

Clarify when to use bootstrap.yml with different consul starters. #194

Open ewolff opened 8 years ago

ewolff commented 8 years ago

http://cloud.spring.io/spring-cloud-consul/spring-cloud-consul.html says that spring.cloud.consul.host and spring.cloud.consul.port should be changed in application.yml. This is wrong - it only works if it is set in bootstrap.properties. I did not try .yml but assume it is the same.

spencergibb commented 8 years ago

It's not wrong if you aren't using consul config. But it does need to be noted similar to what we did in zookeeper: http://cloud.spring.io/spring-cloud-zookeeper/spring-cloud-zookeeper.html#_registering_with_zookeeper

spencergibb commented 8 years ago

In fact, it's already there: https://github.com/spring-cloud/spring-cloud-consul/blob/master/docs/src/main/asciidoc/spring-cloud-consul.adoc#registering-with-consul

The site just needs to be updated.

ewolff commented 8 years ago

Actually I'm not using Consul nor Spring Cloud Config...

spencergibb commented 8 years ago

I'm confused then. When you said "I'm not using Consul" I assume you mean "Consul Config". If you are using spring-cloud-starter-consul-all or spring-cloud-starter-consul-config, then it will need to go in bootstrap, otherwise it shouldn't. If that's not the case, can you describe your setup?

ewolff commented 8 years ago

You are right - I'm not using Consul Config but also not Spring Cloud Config.

spencergibb commented 8 years ago

Which starter are you using, spring-cloud-starter-consul-all or spring-cloud-starter-consul-discovery?

ewolff commented 8 years ago

spring-cloud-starter-consul-all

spencergibb commented 8 years ago

OK, so your app is using consul config even though you don't want it to. If you use spring-cloud-starter-consul-discovery you should be able to use application.properties instead of bootstrap.properties.

ewolff commented 8 years ago

Thanks for the tip! 😄

spencergibb commented 8 years ago

I'll keep this open to clarify in the docs which to use based on which starter you are using.