[jboss-jira] [JBoss JIRA] (WFWIP-59) Enable CDI by default when MP Config usage is detected in the deployment

Jeff Mesnil (JIRA) issues at jboss.org
Tue Jul 17 07:54:00 EDT 2018


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

Jeff Mesnil commented on WFWIP-59:
----------------------------------

That seems backwards to me.
We only register CDI extension if CDI is enabled (more accurately if it is part of a Weld deployment), not the other way around.
That's how it is done for JPA, JMS and JSF

(note that it is also possible to use MicroProfile Config without CDI but it's a minor use case).


> Enable CDI by default when MP Config usage is detected in the deployment
> ------------------------------------------------------------------------
>
>                 Key: WFWIP-59
>                 URL: https://issues.jboss.org/browse/WFWIP-59
>             Project: WildFly WIP
>          Issue Type: Enhancement
>          Components: MP Config
>            Reporter: Rostislav Svoboda
>            Assignee: Jeff Mesnil
>            Priority: Critical
>
> Enable CDI by default when MP Config usage is detected in the deployment.
> Currently users are forced to add empty {{beans.xml}} to the deployment every time they want to use MP Config - e.g. in simple servlet scenario
> {code}
> @WebServlet("/")
> public class HelloServlet extends HttpServlet {
>     @Inject
>     @ConfigProperty(name = "port_number")
>     Integer port;
>     @Override
>     protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
>         resp.getWriter().println("Value of port: " + port);
>     }
> }
> {code}
> MP Config without CDI makes no sense to me. MP Config subsystem should be able to ensure CDI is enabled. CCing [~manovotn] [~brian.stansberry]



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


More information about the jboss-jira mailing list