Hi, We have over 20000 rules in our drools implementation. In drools 5 we could build multiple packages in different threads and then create a Knowledge base joining all those packages together. e.g. Thread: knowledgeB = KnowledgeBuilderFactory.newKnowledgeBuilder(); knowledgeB.add(ResourceFactory.newReaderResource(new StringReader(sb.toString())), ResourceType.DRL);
Then in the main compiler, once all threads have finished KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(conf); for each thread: knowledgeBase.addKnowledgePackages(thrds[t].getKnowledgeB().getKnowledgePackages()); I can't seem to find anyway to do that with the new KIE implementation. What I would like to do is something like: Thread: Create sb to have lots of rules KieServices kieServices = KieServices.Factory.get(); KieFileSystem kfs = kieServices.newKieFileSystem(); kfs.write("src/main/resources/rules.drl", sb.toString()); KieBuilder kieBuilder = kieServices.newKieBuilder(kfs); kieBuilder.buildAll(); ..check errors KieContainer kieContainer = kieServices.newKieContainer(kieBuilder.getKieModule().getReleaseId()); KieBase kieBase = kieContainer.newKieBase(kieBaseConfiguration); In main compiling, create multiple threads, each with its own rule set. Then when all threads completed, take all the kieBase objects and merge into one base. then KieSession ksession=mergedKieBase.newKieSession(); We compile our rules offline and then load into our running servers. The compile server is a multicore server, but buildAll is single threaded. Is this possible? Many thanks for the support, Ric -- View this message in context: http://drools.46999.n3.nabble.com/Multiple-threads-for-KieBuilder-tp4029481.html Sent from the Drools: User forum mailing list archive at Nabble.com. _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users