[jboss-jira] [JBoss JIRA] (WFWIP-60) smallrye-config: Consider logging a message when properties with same key and ordinal are present

Jeff Mesnil (JIRA) issues at jboss.org
Wed Jul 18 04:16:00 EDT 2018


    [ https://issues.jboss.org/browse/WFWIP-60?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13607307#comment-13607307 ] 

Jeff Mesnil commented on WFWIP-60:
----------------------------------

It is not specified in the spec (i.e. config source should have different ordinal).

In our implementation, order between 2 config source with the same ordinal is not specified.
(the code where we sort them is at https://github.com/smallrye/smallrye-config/blob/3b249ee0d13eb438d2ac3b07bc5349ca70120c48/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java#L203).

We can improve this by using the config source name to provide at least consistent order when the ordinal is the same.


> smallrye-config: Consider logging a message when properties with same key and ordinal are present
> -------------------------------------------------------------------------------------------------
>
>                 Key: WFWIP-60
>                 URL: https://issues.jboss.org/browse/WFWIP-60
>             Project: WildFly WIP
>          Issue Type: Enhancement
>          Components: MP Config
>            Reporter: Michal Jurc
>            Assignee: Jeff Mesnil
>
> Consider a deployment with default {{microprofile-config.properties}}:
> {code}managementDefault=Default value from default microprofile-config.properties{code}
> Deployment is deployed on server with the following {{ConfigSource}} defined:
> {code}[standalone at localhost:9990 /] /subsystem=microprofile-config-smallrye/config-source=testdefault:read-resource
> {
>     "outcome" => "success",
>     "result" => {
>         "class" => undefined,
>         "dir" => undefined,
>         "ordinal" => 100,
>         "properties" => {"managementDefault" => "Value from WildFly microprofile-config-smallrye config-source"}
>     }
> }
> {code}
> Property {{"managementDefault"}} is always resolved to {{"Value from WildFly microprofile-config-smallrye config-source"}} in deployment.
> It would be useful to log a {{WARN}} level message when there is conflict like this with a notification of {{ConfigSources}} to save detective work in real world scenarios.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list