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
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