quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.88k stars 2.71k forks source link

Spring Cloud Configuration ordinal customization #44923

Open thibaultmeyer opened 7 hours ago

thibaultmeyer commented 7 hours ago

Description

Currently, the ordinal of the Spring Cloud Configuration values start at 450 (SpringCloudConfigClientConfigSourceFactory#76). This value is a bit high, according to the Quarkus documentation, System Properties have a ordinal of 400. With a ordinal of 450, Spring Cloud Configuration values cannot be overridden by existing configuration sources.

Implementation ideas

Like the extension quarkus-vault, it could be a good idea to let the developper to choose ordinal of the Spring Cloud Configuration sources.

Currently

int ordinal = 450;
// Profiles are looked from the highest ordinal to lowest, so we reverse the collection to build the source list
Collections.reverse(responses);
for (Response response : responses) {
    /* ... */

Changes

int ordinal = config.ordinal();
// Profiles are looked from the highest ordinal to lowest, so we reverse the collection to build the source list
Collections.reverse(responses);
for (Response response : responses) {
    /* ... */

config.ordinal() will be defined in SpringCloudConfigClientConfig with default value of 450.

quarkus-bot[bot] commented 7 hours ago

/cc @aureamunoz (spring), @geoand (spring), @radcortez (config)