[jboss-jira] [JBoss JIRA] (WFWIP-314) [EAP7-1386] additional ConfigSources are always initialized
Petr Kremensky (Jira)
issues at jboss.org
Mon Apr 27 04:19:00 EDT 2020
[ https://issues.redhat.com/browse/WFWIP-314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Petr Kremensky closed WFWIP-314.
--------------------------------
Resolution: Explained
Thanks [~ron_sigal],
I can see now that this is indeed an implementation specific behaviour, thus closing as explained.
> [EAP7-1386] additional ConfigSources are always initialized
> -----------------------------------------------------------
>
> Key: WFWIP-314
> URL: https://issues.redhat.com/browse/WFWIP-314
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Minor
>
> I've noticed that three additional config sources provided by EAP7-1386 are always registered among config sources, even they are empty. I'll probably reject this one myself soon :) as I still have to look into the implementation of SPI for mp config, so I can assume that this is just out of box behaviour we have no control over.
> Test with a simple servlet from [helloworld|https://github.com/wildfly/quickstart/tree/master/helloworld] quickstart with following addition:
> {code:java}
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> {code}
> output:
> {noformat}
> =================================
> SysPropConfigSource
> 400
> [Standalone], awt.toolkit, ...
> =================================
> EnvConfigSource
> 300
> PATH, INVOCATION_ID, ...
> =================================
> null:null:ServletConfigSource
> 60
> =================================
> null:null:FilterConfigSource
> 50
> =================================
> null:ServletContextConfigSource
> 40
> {noformat}
> Notice that {{PropertiesConfigSource}} is missing there as none was put to classpath. On the other hand {PropertiesConfigSource} is present once added to classpath, even it is empty.
> {noformat}
> ...
> =================================
> PropertiesConfigSource[source=vfs:/content/helloworld.war/WEB-INF/classes/META-INF/microprofile-config.properties]
> 100
> Property names:
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> {noformat}
> As stated before, I'd probably close this one myself once I'll take deeper look into it.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list