We're using Spring Cloud Consul Config 1.3-RELEASE on Java 8 for simple app helloworldclient, works as expected with bootstrap.xml...
spring:
cloud:
consul:
token: xxxx-xxxx-xxxx-xxxx
discovery:
enabled: true
register: true
service-name: helloworldclient-xyz123
health-check-url: ${HEALTH_CHECK_URL}
config:
profile-separator: '/'
enabled: true
format: yaml
host: ${CONSUL_HTTP_ADDR}
port: 8500
application:
name: helloworldclient
Running the app with profile dev, this is the loaded config from /env...
"consul:config/helloworldclient/dev/": {
"product[0].sku": "BL394D",
"product[0].quantity": 8
}
All that is fine, but we're not sure why the remaining consul config sections are even present, and what they're used for:
"consul:config/application/dev/": {},
"consul:config/application/": {},
This is interesting because we have a requirement for shared config such that multiple applications have a way load common, environment-specific config from consul, if possible; some questions to determine if this is a viable solution:
Questions
- Is SCC attempting to read from those locations in addition to the application config path?
- Is the default folder
config/applicationconfigurable such that on startup the app reads fromconfig/mysharedconfiginstead? - Is it suitable to use
/config/application/devas a shared config location where multiple applications can load common, environment-specific config?