-
Notifications
You must be signed in to change notification settings - Fork 121
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
Extract ConfigSource implementations from core #178
Comments
@jmesnil @dmlloyd @phillip-kruger I've extracted out the various As the main code base makes direct reference to them, it doesn't require a service provider file for them to be found. However, it's needed if they're used outside SmallRye. I wasn't sure if it would cause issues by adding service files for each of the separate config sources. Would it just mean they're discovered twice? Once in our "default" list and then again in "discovered". Does that matter? |
@jmesnil is Wondering if we actually need it? |
We don't want config sources to be discovered twice, for sure. The "default" vs "discovered" distinction was probably an error, but I think it's an error we'll have to live with: the default config sources should not have service files. If it becomes a cyclic dependency problem though (such that you need |
@dmlloyd - Just out of interest, why should the default config source not have service files ? |
@kenfinnigan |
@kenfinnigan DirConfigSource is used in Thorntail and WildFly. It provides access to Kubernetes ConfigMaps |
@Ladicek @jmesnil how is it used at present in Thorntail and WildFly? I ask because it has a non-default constructor, which causes a failure of a service file is added to "discover it". I was wondering if we needed a |
I'll defer to @jmesnil, but my understanding is that the WildFly subsystem allows configuring a set of config sources, and instantiates them itself. |
It's a problem when both Now you could say "well, it's easy, simply don't add the default sources if Therefore default sources shouldn't use the same service file mechanism as discovered sources. You might wonder though: "but you suggested using a different service file for default sources!" However I will point out that in this case, with no specification telling us what to do, we can use our own class loader to locate the special service files for the default sources, rather than the builder's target class loader. Granted this becomes slightly complicated if we move the all of the built-in sources to their own submodules (something I'm only about 50% sure is a good idea; why not do the same for converters then?). However I don't think this puts an unreasonable burden on container vendors (the only people crazy enough to do these class loader gymnastics in the first place) - they simply have to ensure that the built in config sources are available to the class loader of the SmallRye Config API if they want to have a shot at passing the TCK. |
Maybe we ought to rename it to "KubernetesConfigMapConfigSource" or at least "FileSystemConfigSource". Every time I forget what it is, and I end up thinking it has something to do with LDAP! 🙂 |
I'm not opposed to renaming either if we can find a good one |
I couldn't find Can anyone shed light on how it's used in WF, want to make sure I'm not making a mess! |
Thorntail uses (a fork of) the WildFly subsystem for MP Config: https://github.com/thorntail/microprofile-config-wildfly/ |
doh, separate project, no wonder I didn't find it, thanks. This is what happens when it's been a long time since I've looked at Thorntail, I forget everything! |
@kenfinnigan WildFly / Thorntail directly instantiates DirConfigSource from the management model (https://github.com/thorntail/microprofile-config-wildfly/blob/1.x/extension/src/main/java/org/wildfly/extension/microprofile/config/ConfigSourceDefinition.java#L114). |
@jmesnil would it break things if there was a service loadable From a quick look through the WF code I couldn't see it doing any of that type of loading |
I'm not opposed to rename it but -1 for |
What about |
@kenfinnigan are you taking about a service loadable |
@jmesnil right, otherwise it's a |
I suppose we can make a service loadable version that would get the directory parameter from a config property... |
We can have a non default ctor, it would just mean we need a Currently I had a service file for My concern was whether that would then be automatically picked up by WF/TT |
It seems almost always better to use |
Now i've got myself confused as to how a Am I chicken and egging it here, or am I missing something obvious? Side note, is it the weekend yet?! |
@kenfinnigan that'd be quite similar to our zookeeper implementation https://github.com/smallrye/smallrye-config/tree/master/sources/zookeeper in getCuratorClient() The ConfigSourceProvider would look for a well known property ( A key design is that Does that make sense? and please reply yes, I've a 3-day week-end starting in 1/2 hour :) |
Is that design enshrined anywhere? There's nothing in the javadoc about that. If it's "safe" for |
It does make sense for a config provider to be able to recursively probe config from the |
That's what I was suspecting, so back to chicken and egg then. How are you meant to have For now we may have to have a "disembodied" |
You can't really. Well I mean there are system properties and so forth but there's no "proper" way to do it. I was thinking it'd be nice if there was though... maybe some way for a config source to reference config from a sort of "view" of higher-ordinal sources?
That's fine to start with IMO. |
I created eclipse/microprofile-config#470 to cover offering something in the spec re |
David is right, this pattern requires additional constraints:
|
@jmesnil what you describe are restrictions based on the current workings right? If we had the means to register new |
No description provided.
The text was updated successfully, but these errors were encountered: