问题
The "User Guide" for Drools 6 states that a camel endpoint for drools shall be in the below format:
<to uri="kie:{1}/{2}" />
where
{1}
: Execution Node identifier that is registered in theCamelContext
{2}
: Knowledge Session identifier that was registered in the Execution Node with identifier{1}
Doubt # 1 :
If the sessions are created before the endpoints are built, how the incremental changes in kmodule will be picked up by the sessions created before?
Statement about KScanner from the document:
If the KieScanner finds, in the Maven repository, an updated version of the Kie project used by that KieContainer it automatically downloads the new version and triggers an incremental build of the new project. From this moment all the new KieBases and KieSessions created from that KieContainer will use the new project version.
Doubt # 2
And..I am trying to configure this endpoint to route to ksessions dynamically.
Traversing through the source code, I tried declaring the uri to kie:dynamic
and adding new sessions to KieEndpoint.executorsByName
, like
KieEndpoint endPoint = (KieEndpoint)camel.getEndpoint("kie:dynamic");
endPoint.executorsByName.put(sessionName, kSession);
Is this the right way of adding the dynamic sessions? I didn't find any hint in user guide for this.
来源:https://stackoverflow.com/questions/24526313/dynamic-drools-endpoint-update-in-drools-camel-server