i just implemented an config server for my application, with the following structure in my config-repo
/
> application.properties
> application-test.properties
> application-dev.properties
> application-prod.properties
/test-service
> application.properties
> application-test.properties
> application-dev.properties
> application-prod.properties
When i access the config-server over this url http://localhost:8102/test-service/dev
then i get this back.
{
"name": "test-service",
"profiles": [
"dev"
],
"label": null,
"version": "cdf1f2b381b4acf9b48f2c9787379a0efaec582d",
"state": null,
"propertySources": [
{
"name": ".../test-service/application.properties",
"source": {
"test2": "test2"
}
},
{
"name": ".../application-dev.properties",
"source": {
"test": "test"
}
},
{
"name": ".../application.properties",
"source": {
"spring.servlet.multipart.max-file-size": "5MB",
"spring.servlet.multipart.max-request-size": "5MB"
}
}
]
}
But for some reason, the service can only access the Data of the first entry of the propertySources
Arry. It completly ignores the other ones.
This is the config i have in my microservice to access the config-service
spring.cloud.config.uri: http://localhost:8102
spring.config.import: optional:http://localhost:8102/
spring.cloud.config.name: test-service
spring.cloud.config.failFast=true
spring.cloud.config.discovery.enabled=false
spring.cloud.config.profile: dev