Red Hat Bugzilla – Bug 780950
BusinessRulesProcessor action needs better support for stateful CEP scenarios
Last modified: 2012-03-15 01:45:46 EDT
In order to support common CEP scenarios, the BusinessRulesProcessor action needs an option to automatically control the lifecycle of the stateful knowledge session.
Currently, if using stateful knowledge sessions, you must control when the session is created, reused, and disposed of using message properties. In a CEP scenario, there is no need for this lifecycle nor is it desired.
It would be better to have an option that will automatically create a new session upon receiving the first message and automatically reuse the existing session upon receiving subsequent messages. Dispose would not be needed as Drools automatically manages working memory in stream mode.
Changing this at this point would have too big of an impact.
It is possible to use CEP, without referencing DISPOSE/CONTINUE, by defining the "org.jboss.soa.esb.services.rules.continueState" property within jbossesb-properties.xml as "true". This will affect all references of stateful sessions as there is currently no way to specify this per action.
I was aware of this option, and as you point out it could be too global of a setting in certain scenarios. I still think it would be best to keep this setting as part of the jboss-esb.xml at the BRP action (or even a new CEP action). For now, I worked around this using a custom action which controls the dispose/continue options based on receiving the first message or subsequent messages.
Attached diff which enables default continue behaviour per action
Attachment: Added: cep_diff
Attachment: Added: test-cep-esb.zip
Link: Added: This issue relates to JBESB-3698
Committed Kevin's patch to ESB, will be in ER5.
cunningts-imac:product cunningt$ svn commit
Transmitting file data .........
Committed revision 37516.