Skip to content

Config Client property sources in different order after refresh in Hoxton.SR1 #704

@habuma

Description

@habuma

Describe the bug
With any version, if I setup a config server with https://github.com/habuma/myapp-config as the backend, with search-paths set to "sub", and a client connected to that server, and start the server before the client, I see the following two entries in /actuator/env:

        {
            "name": "configService:https://github.com/habuma/myapp-config/sub/application.yml",
            "properties": {
               ...
            }
        },
        {
            "name": "configService:https://github.com/habuma/myapp-config/application.yml (document #0)",
            "properties": {
                ...
            }
        },

Also, if the client is based on Hoxton.RELEASE and I start the client before the server starts, I get nothing in /actuator/env from the config server, but if I do a POST to /actuator/refresh, I get the same results as above.

All of this means that the properties in sub/application.yml take precedence over the ones in application.yml.

However, if the client is based on Hoxton.SR1 and I start the client before the server starts, then POST to /actuator/refresh, the two property sources are in reverse order:

        {
            "name": "configService:https://github.com/habuma/myapp-config/application.yml (document #0)",
            "properties": {
                ...
            }
        },
        {
            "name": "configService:https://github.com/habuma/myapp-config/sub/application.yml",
            "properties": {
               ...
            }
        },

This means that the properties in application.yml will take precedence over those in sub/application.yml--the opposite of what happens with a Hoxton.RELEASE client or if I start the client after the server starts.

I'm unsure which would be considered the correct order, but it's clear that the experience is inconsistent with Hoxton.SR1 depending on the timing of when the client and server start.

Sample

It's just a very simple config server/client setup using a Git URI of "https://github.com/habuma/myapp-config" and search-paths set to "sub". Then...

  • Start the server before the client to see application.yml appear before sub/application.yml. (This arrangement remains even after a POST to /actuator/refresh.)
  • Start the client before the server and then POST to the client's /actuator/refresh endpoint to see sub/application.yml appear before application.yml with a Hoxton.SR1 client (or the other way with a Hoxton.RELEASE client).

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