[jboss-jira] [JBoss JIRA] (DROOLS-3328) PhreakAsyncSendNode triggers service discovery even when it's not used

Edoardo Vacchi (Jira) issues at jboss.org
Mon Nov 19 10:42:00 EST 2018


     [ https://issues.jboss.org/browse/DROOLS-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Edoardo Vacchi updated DROOLS-3328:
-----------------------------------
    Sprint: 2018 Week 45-47


> PhreakAsyncSendNode triggers service discovery even when it's not used
> ----------------------------------------------------------------------
>
>                 Key: DROOLS-3328
>                 URL: https://issues.jboss.org/browse/DROOLS-3328
>             Project: Drools
>          Issue Type: Enhancement
>            Reporter: Edoardo Vacchi
>            Assignee: Edoardo Vacchi
>            Priority: Major
>              Labels: drools-core
>
> I am investigating ways to startup a stripped down version of the rule engine.
> in 7.8.0 the following snippet did _not_ trigger service discovery : 
> {code}
>         CanonicalKiePackages packages = new MyKiePackagesBuilder(model, ProjectClassLoader.createProjectClassLoader()).build();
>         InternalKnowledgeBase kBase = new KnowledgeBaseImpl("defaultname", null);
>         kBase.addPackages(packages.getKiePackages());
> kieSession = kBase.newKieSession();
> {code}
> this is because no call to {{ExecutorProviderFactory.getExecutorProvider()}} occurs anywhere. However in a recent release, {{PhreakAsyncSendNode}} invokes this method, while initializing a static field
> {code}
>     private static final Executor executor = ExecutorProviderFactory.getExecutorProvider().getExecutor();
> {code}
> This triggers a *full service discovery* which loads a bunch of other unrelated services.
> Solution: avoid service discovery in that class, or delegate to a method (the service utility caches that field anyway, so it's not necessary to set a static field there)



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list