-
Notifications
You must be signed in to change notification settings - Fork 124
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
Ability to use already retrieved Config in configuring things further down the chain #196
Comments
I'll look at this a.s.a.p. |
Hey folks, Would you mind providing me some details on what the status of this is? I'd love to try it out if there is something in the works and / or help out since I'm really interested in it from the Quarkus side of things. |
It might not be a workable idea, at least not as presented. I think it might be a good idea to break out the use cases though, and maybe have issues for each of those, since this issue may or may not be solvable. |
The use case I have in mind is to be able to use configuration from some source in order to then be able to instantiate a class that will create another source based on some data it will fetch (most likely over the wire). |
Let's start up a different issue for that. If we come up with a solution for this one, we can solve that with this, but if not, we can close this one out but still keep pursuing the use case. |
OK, I created #215 |
Our Lines 88 to 95 in 7f48ead
This may cause issues with a possible Stackoverflow when looking for configs, so we really need to provide a way to configure ConfigSources. Maybe we can use a similar solution to the one we use to instantiate interceptors in The real question is, what should be exposed to the ConfigSource being built? Exposing the Maybe just expose a |
The interception model is really perfect for this use case: each config source could conceptually access all the ones configured before it, no state is mutated late, etc. I think it would be great if there were a way to unify the config source and interceptor models. In particular I think that interceptors need a way to intercept config source iteration (that's the missing piece). |
Yes, I was first thinking that interceptors could easily solve this. On the other hand, I still have some doubts if both concepts should be mixed, at least to the implementor. A Maybe they don't need to intercept the config source iteration. Maybe just intercepting the current "view" of already built ConfigSources is enough. |
There is an existing reason (and corresponding bug, which I should open) for interceptors to need to intercept iteration. In Quarkus, we iterate property names to find properties defined in maps that we wouldn't ordinarily be able to find. If we switch to using an interceptor for configuration profile, then iteration will no longer return properties that are defined in profiles which don't have a corresponding non-profile configuration key defined somewhere. On a more general note, if one were to include iteration in to interceptors, then an interceptor would be able to do everything that a config source can do (but better). |
Ok! Please open up the issue :) |
Opened in #285. |
I believe most of the work to support this is in place. We now just need to define the right API for each ConfigSource to access their predecessors. An issue here is that we don't control the ConfigSource creation, since this is done by the SPI and the user might give us their own instances via Maybe we could support a @dmlloyd Any other brilliant idea? :) |
Remember that we aren't really constrained by the spec: if it doesn't do what we want, we don't have to comply exactly to it. But in any case there's nothing preventing our users for implementing sources using the interceptor API rather than the CS API. |
There is an issue reported in the spec, but apart from a couple of ideas here and there, there is no actual proposal, so we can figure out something and make a proposal. The idea was mostly to not introduce breaking changes, but maybe we can introduce a different I'll try to come up with a few prototypes. |
If we need to break spec/TCK to move things forward, then do so |
Hey @kenfinnigan welcome back :) We have a proposal here: #313 |
* Initial work to mix sources and interceptors priorities. * Fix for #196. Support configurable Config Sources. * Added documentation to ConfigSourceFactory.
Done in #313. |
See microprofile/microprofile-config#470 for some details.
Basically explore loading
ConfigSourceProvider
andConfigSource
in low to high ordinal number, such that higher ordinal instances can use the "as is" config from lower ordinal instancesThe text was updated successfully, but these errors were encountered: