[rules-users] KnowledgeAgent and Pipeline

David Zeigler dzeigler at gmail.com
Tue May 12 11:41:15 EDT 2009


Hi,
I've set up the KnowledgeAgent to automatically reload the rules
resources if they change.  If I use this with a Pipeline, it seems
that its StatelessKnowledgeSession is not reloaded automatically.  The
only way I've been able to get the Pipeline to reflect the rules
change is to do the following prior to each pipeline.insert():

StatelessKnowledgeSession ksession =
kagent.getKnowledgeBase().newStatelessKnowledgeSession();
Pipeline pipeline =
PipelineFactory.newStatelessKnowledgeSessionPipeline(ksession);
pipeline.setReceiver( messageTransformer );

Reloading the pipeline for each request adds a lot of overhead (halves
my transactions per second).  Is there a way to automatically reload
the Pipeline's session when its needed instead of recreating the
Pipeline prior to each insert?  I see there is a
ResourceChangeListener interface that I could probably use to
accomplish this, but I figured I'd ask in case there is a better way
to handle this case with pipelines.  What's the best approach?

I'm using 5.0.0.CR1.

Thanks!
David



More information about the rules-users mailing list