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

Allow to create runtime only ConfigSource #25999

Closed
loicmathieu opened this issue Jun 8, 2022 · 4 comments · Fixed by #35322
Closed

Allow to create runtime only ConfigSource #25999

loicmathieu opened this issue Jun 8, 2022 · 4 comments · Fixed by #35322
Assignees
Labels
area/config kind/enhancement New feature or request
Milestone

Comments

@loicmathieu
Copy link
Contributor

Description

Currently, if we define a ConfigSource via a ConfigSourceFactory, this ConfigSource is initialized once at build time (and the getPropertyNames() method is called) and once at runtime.

We should be able to define runtime only ConfigSource / ConfigSourceFactory for exemple for ConfigSource that load a file at runtime which can be not found at build time. As ConfigSourceFactory allow to access the ConfigSourceContext which can be different at build and runtime it's important to have this functionality.

See this Zulip discussion for context: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/ConfigSourceFactory.20initialized.20at.20build.20time

Implementation ideas

No response

@loicmathieu loicmathieu added the kind/enhancement New feature or request label Jun 8, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 8, 2022

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip.

This message is automatically generated by a bot.

@loicmathieu
Copy link
Contributor Author

/cc @dmlloyd @radcortez

@raoua-eng
Copy link

It would be very helpful if the configuration source is initialized at runtime, this will help avoid the chicken egg problem.

But what about configurations that need to be initialized at build time?

@radcortez radcortez self-assigned this Jun 13, 2022
@radcortez
Copy link
Member

I'll have to think about this.

I guess the best option is to introduce a new annotation that allows you to control the registration of all Config components per phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants