Skip to content

Property Source Beans out of order when Config Server not available at startup, but later becomes available #815

Description

@stwomack
"applicationConfig: [classpath:/application.properties]": {
"message": "This IS the default message packaged in the application!"
},
"applicationConfig: [classpath:/bootstrap.yml]": {
"spring.application.name": "config-client-test",
"spring.cloud.config.uri": "http://localhost:8000",
"server.port": 8888,
"management.security.enabled": false
},

When a config client app is started & its config server is unreachable, there's no property sources from the server initially. But when the config server does become available, and a /refresh POST is done, the config client will now connect to the config server, but the property sources from the config server will be lower in precedence than the initially loaded property sources (from classpath, etc.) and thus the application will not now override properties from the config server. The applicationConfig beans after the client has finally connected are ordered as follows (meaning the client app still uses what it initially loaded, instead of the properties from the config server):

"applicationConfig: [classpath:/application.properties]": { "message": "This IS the default message packaged in the application!" }, "applicationConfig: [classpath:/bootstrap.yml]": { "spring.application.name": "config-client-test", "spring.cloud.config.uri": "http://localhost:8000", "server.port": 8888, "management.security.enabled": false },
"configService:configClient": {
"config.client.version": "5fb8eb09959a3601cb310f68f8ac6dc0ed66816b"
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions