Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Emily Jiang
    @Emily-Jiang
    By the way, I have asked Kevin to mentor MP Config release. He will send an email to microprofile-wg for voting. I'll send email to the other parties and then give him a go ahead.
    Roberto Cortez
    @radcortez
    Ok!
    Emily Jiang
    @Emily-Jiang
    thanks
    Duncan
    @dabloem
    Hi all, I was wondering if there is already something to bring mp-config to spring-boot?
    So, developers can use @ConfigProperty instead of @Value ?
    Jan Bernitt
    @jbee
    isn't MP config dependent on CDI which you do not have in a spring environment?
    Roberto Cortez
    @radcortez
    Yes, for @NonBinding
    spring supports @Inject, not sure now it deals with @NonBinding
    Jan Bernitt
    @jbee
    surely you can make the annotation work in some way on top of spring concepts but it might need some adaptors or even replacement of classes I would guess
    Duncan
    @dabloem
    Well, I did some proof of concept. And it works
    however, I am not a spring guru
    Roberto Cortez
    @radcortez
    which MP Config implementation are you using?
    Duncan
    @dabloem
    I implemented a BeanPostProcessor which is looking for ConfigProperty on fields, and if found it adds a FieldCallBack, which does the lookup via ConfigProvider.getConfig()
    Roberto Cortez
    @radcortez
    ah great
    Duncan
    @dabloem
    Smallrye and Geronimo both work
    Roberto Cortez
    @radcortez
    unfortunately for a single annotation you do required to have the CDI API jar in your CP
    Duncan
    @dabloem
    But because it was not that hard, I was just wondering if this already exists, and probably a bit more mature
    Roberto Cortez
    @radcortez
    not that I’m aware, because no one ever asked for it. usually spring developers stick to what they already have
    but that is interesting work, are you interested in contributing something into SR? :)
    Duncan
    @dabloem
    @radcortez yes, actually (in our company) we would like to advocate the use of @Inject and @Named (instead of @Autowired and @Component)
    so, the applications are not tightly coupled to any specific framework
    therefore our search to make @ConfigProperty Spring ' compatible'
    Roberto Cortez
    @radcortez
    thats great, probably a MP Config intregration may requires some additional pieces
    Duncan
    @dabloem
    of course I am willing to contribute
    Roberto Cortez
    @radcortez
    Duncan
    @dabloem
    exactly
    Roberto Cortez
    @radcortez
    a lot of that are actually validations before doing the injection
    Emily Jiang
    @Emily-Jiang
    Spring already supports @Inject etc. It will be good to get MP Config APIs work on spring boot apps
    Duncan
    @dabloem
    okay, I will make our sources public, see if there are any additional validations to add.
    Roberto Cortez
    @radcortez
    I’m happy to host an integration project in SR Config. Actually I have a PR for some time to split the CDI integration in its own module, so it would be easier for consumers to just use the runtime
    Duncan
    @dabloem
    and hopefully more experienced Spring devs can give feedback and suggestions
    (actually the @Inject is not required (currently), just like Quarkus, @ConfigProperty is sufficient
    Emily Jiang
    @Emily-Jiang
    Since it can work with either smallrye or Geronimo, I think it will be great integration module independent to the implementations so that people can consume this and bring in the chosen impl
    Duncan
    @dabloem
    @radcortez @Emily-Jiang this is the initial draft: https://github.com/abnamrocoesd/microprofile-config-spring
    Emily Jiang
    @Emily-Jiang
    @dabloem thanks, I will clone it and try it out later
    Duncan
    @dabloem
    The current issue is how to handle defaultValue, because I think I cannot reuse converters from the used implementations via (mp-config) api' s
    Roberto Cortez
    @radcortez
    there is a new API in Config 2.0 that allows you to retrieve the Converter
    bingo
    @finesoft
    Why is the default implementation of ConfigSource.getPropertyNames removed in 2.0? It seems that this will cause compatibility issues. For example, some ConfigSources in the'Resteasy' project do not implement this method, and errors will occur at startup.
    6 replies
    Emily Jiang
    @Emily-Jiang
    @finesoft please read eclipse/microprofile-config#431 for the getPropertyNames change.
    Tomas Langer
    @tomas-langer
    Hi, I am implementing config 2.0, and I have trouble with test EmptyValuesTestProgrammaticLookup - cannot find appropriate part in the specification that defines these rules. Can somebody please point me to the right place? For example ,bar should resolve into a single element bar, where we resolved it to and empty string and bar in previous version (and that seems logical to me, as the comma clearly states that there is an additional element). Also how would I define an empty string in a list in config?
    11 replies
    Tomas Langer
    @tomas-langer
    Another question - why is the ConfigProperties supporting private fields? That requires every implementation to handle reflection with illegal access. This will cause trouble with any newer version of Java, it is an implicit security risk and it is hard to implement.
    20 replies
    Tomas Langer
    @tomas-langer
    Configuration profile - how should I solve the "catch 22" thing - the spec says I should use the config sources as usual (based on ordinal) to obtain the profile to be used. And the next section defines file based configuration sources with different file names. Do I need to construct the configuration twice (eg. load all sources as configured in builder, determine profile, then load the sources again adding profile specific sources)? Or when loading sources, should I use only env vars and system properties to determine the profile? What if env vars & system properties are not used (e.g. user explicitly defined to only used discovered sources)?
    17 replies
    Tomas Langer
    @tomas-langer
    Related to empty values mentioned above - how am I supposed to configure a password that is an empty string? We have tests that use a database user with an empty password. Config changes it to null (as if it was not configured according to 2.0 spec). Now my tests fails on NPE, because the spec treats empty value the same as no value at all. And as far as I could find, there is no way to define this AT ALL.