[
http://jira.jboss.com/jira/browse/JBESB-1504?page=comments#action_12419186 ]
Kevin Conner commented on JBESB-1504:
-------------------------------------
Daniel has asked me to take a look at this issues and, to be honest, I had originally
thought that the test was invalid. It is definitely not doing what i suspect you want but
this is irrelevant to the performance issue you have raised.
It is clear from the codebase that the DslHelper was not written with performance in
mind.
There are a couple of obvious performance issues
- DroolsRuleService reads the rule file on every message invocation (if ruleReload is
specified)
- DslHelper parses the XML on every invocation
It may also be of benefit to cache the results from these queries although we should wait
until the parsing issue has been addressed to see how beneficial this would be. We should
certainly be using some type of context to store the intermediate information.
In addition to this there are a couple of other issues
- The DslHelper only handles the first match of the XPath expression as it requests Node
or String responses. We should extend this capability to handle NodeLists for cases such
as the above queries.
(It may be better just to allow xpath to evaluate the complete expression instead of
specifying comparisons)
- The DslHelper restricts the xpath expression to the message payload whereas it may be
desirable to query on other sections of the message.
I believe the above issues need to be addressed in order to make the XPath/DslHelper
useful.
CBR using rules has poor performance
------------------------------------
Key: JBESB-1504
URL:
http://jira.jboss.com/jira/browse/JBESB-1504
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Content Based Routing
Affects Versions: 4.2.1
Environment: SOA-P 4.2.0.beta1
Reporter: Martin Vecera
Assigned To: Daniel Bevenius
Fix For: 4.4
Attachments: build.properties, JBESB-1504.tar.bz2
We have a simple performance that uses ContentBasedRouter to route XML messages:
<action class="org.jboss.soa.esb.actions.ContentBasedRouter"
name="ContentBasedRouter">
<property name="ruleSet"
value="MyESBRules-XPath.drl"/>
<property name="ruleLanguage"
value="XPathLanguage.dsl"/>
<property name="ruleReload" value="true"/>
<property name="destinations">
<route-to destination-name="regular1"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular2"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular3"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular4"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular5"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular6"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular7"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular8"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular9"
service-category="wiretapCategory1"
service-name="regularService"/>
<route-to destination-name="regular0"
service-category="wiretapCategory1" service-name="catchService"/>
</property>
</action>
I have created a rule set of 100 rules. Like this:
package com.jboss.soa.esb.routing.cbr
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageType;
expander XPathLanguage.dsl
global java.util.List destinations;
rule "ProductId1"
salience 100
when
xpathEquals "/Order/OrderLines/OrderLine/Product/@productId", "1"
then
Destination : "regular1";
end
...
rule "ProductId299"
salience 100
when
xpathEquals "/Order/OrderLines/OrderLine/Product/@productId",
"299"
then
Destination : "regular0";
end
rule "Default rule"
salience 1
when
then
Destination : "regular0";
end
See
https://svn.corp.jboss.com/repos/soa/trunk/qa/tests/quickstarts/performan...
for the whole file.
The performance is very poor (see SOA-240 for reports). Only a tens of messages per
second.
What's the problem here? Is the Rules engine really so slow? Or is it parsing the
file every time a message arrives?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira