Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Cloud Configuration ordinal customization #44923

Closed
thibaultmeyer opened this issue Dec 4, 2024 · 8 comments · Fixed by #44952
Closed

Spring Cloud Configuration ordinal customization #44923

thibaultmeyer opened this issue Dec 4, 2024 · 8 comments · Fixed by #44952
Labels
area/config area/spring Issues relating to the Spring integration kind/enhancement New feature or request
Milestone

Comments

@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Dec 4, 2024

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.

@thibaultmeyer thibaultmeyer added the kind/enhancement New feature or request label Dec 4, 2024
@quarkus-bot quarkus-bot bot added area/config area/spring Issues relating to the Spring integration labels Dec 4, 2024
Copy link

quarkus-bot bot commented Dec 4, 2024

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

@geoand
Copy link
Contributor

geoand commented Dec 5, 2024

Makes sense!

Would you like to contribute that?

@thibaultmeyer
Copy link
Contributor Author

hi @geoand

no problem, I'm preparing a pull request.

@geoand
Copy link
Contributor

geoand commented Dec 5, 2024

🙏🏽

thibaultmeyer added a commit to thibaultmeyer/quarkus that referenced this issue Dec 5, 2024
@thibaultmeyer
Copy link
Contributor Author

@geoand

I've just opened a PR to add ordinal customisation

@geoand geoand closed this as completed in 20c598d Dec 6, 2024
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Dec 6, 2024
amusarra pushed a commit to amusarra/quarkus that referenced this issue Dec 6, 2024
@gsmet
Copy link
Member

gsmet commented Dec 9, 2024

@thibaultmeyer do you have the default ordinal for Quarkus Vault in mind? Probably a good idea to make them consistent.

Copy link

quarkus-bot bot commented Dec 9, 2024

@gsmet triage/backport* labels may not be added to an issue. Please add them to the corresponding pull request.

This message is automatically generated by a bot.

@thibaultmeyer
Copy link
Contributor Author

hi @gsmet

quarkus-vault ordinal is 270 (VaultRuntimeConfig.java#L32).

@gsmet gsmet modified the milestones: 3.18 - main, 3.17.4 Dec 10, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Dec 10, 2024
Resolves: quarkusio#44923
Signed-off-by: Thibault Meyer <[email protected]>
(cherry picked from commit 20c598d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config area/spring Issues relating to the Spring integration kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants