Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-1504

CBR using rules has poor performance

    Details

      Description

      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/performance8/MyESBRules-XPath.drl 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?

        Gliffy Diagrams

          Attachments

          1. build.properties
            2 kB
          2. DslHelper.java
            13 kB
          3. DslHelperUnitTest.java
            5 kB
          4. JBESB-1504.tar.bz2
            102 kB

            Issue Links

              Activity

                People

                • Assignee:
                  beve Daniel Bevenius
                  Reporter:
                  mvecera Martin Vecera
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: