Is there way from API to get KieBaseConfiguration from a KieBase?

416 views
Skip to first unread message

Matteo Mortari

unread,
Aug 20, 2014, 7:49:55 AM8/20/14
to drools...@googlegroups.com
Ciao, I'm using 6.1.0.Final.

If I create KieBase from definition of kmodule.xml, I would like to know if there is a way via API to check what is the KieBaseConfiguration defined, please?

Namely, I would like to check the eventProcessingMode setting of a given kieBase instance.
While for KieSession instance there is method getSessionConfiguration(), I cannot find analogous for KieBase, nor another way.

Follows other 2 things I've tried, unfortunately without success:
  • If I try enable JMX MBean via command line option -Ddrools.mbeans=enabled , it does not enable the MBean - I do attach screenshots.

  • If I try enable JMX MBean via API, I need to define a KieBaseConfiguration instance, and this would *overwrite* the settings of eventProcessingMode defined in the kmodule.
For instance I cannot enable JMX MBean via API because if I have this defined in the kmodule.xml

<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
   
<kbase name="default" default="true" />
   
<kbase name="kbStream" default="false" eventProcessingMode="stream" />

And then I do:

KieBaseConfiguration kieBaseConf = kieServices.newKieBaseConfiguration();
kieBaseConf
.setOption( MBeansOption.ENABLED );
KieBase kieBase = kContainer.newKieBase("kbStream", kieBaseConf);

because the default for eventProcessingMode is CLOUD, it would be overwritten with the default CLOUD of the kieBaseConf instance, instead of picking it up, mixing-in of the setting explicitly set as STREAM in kmodule.xml.

I would also like to ask if it's normal that if I try to enable JMX MBean via command line option -Ddrools.mbeans=enabled , it does not enable the MBean or I'm doing something wrong, please?

Thanks
Ciao
MM

 


Matteo Mortari

unread,
Aug 20, 2014, 10:08:29 AM8/20/14
to Edson Tirelli, drools...@googlegroups.com
Edson, thank you for your feedback.

Now that I understand what should be the proper solution based on your feedback, I also was able to discover DROOLS-166 bug "feat. request" on JIRA; so I've re-used that record instead of creating a new one, adding the relevant comment.
https://issues.jboss.org/browse/DROOLS-166

I do confirm that the workaround you provided in the meantime works for me, thank you very much.

Also thank you for your feedback on MBean command line option, I do confirm it works using -Dkie.mbeans=enabled 

Ciao,
MM


On Wed, Aug 20, 2014 at 3:25 PM, Edson Tirelli <ed.ti...@gmail.com> wrote:

    Matteo, thank you for reporting this.

    As we moved to a minimal public API, the getConfiguration() method was moved to the internal API, but I think this can be reconsidered. May I ask you please to open a JIRA requesting this method be moved to the public API?

    Meanwhile, as a workaround, you will need to cast it to the internal API: InternalKnowledgeBase.getConfiguration().

    Regarding the MBeans, when we refactored the code to use "Kie" as the umbrella brand, the option was renamed to "kie.mbeans=enabled", but I see we missed this in the docs. Sorry about it, will fix it. 

    Edson



--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.

To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/2f5313bd-56e8-4f6b-b0ec-5c4d8a3b92ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
  Edson Tirelli
  Principal Software Engineer 
  Red Hat Business Systems and Intelligence Group


Reply all
Reply to author
Forward
0 new messages