이 콘텐츠는 선택한 언어로 제공되지 않습니다.

13.7.12. ContentBasedRouter


Expand
Class org.jboss.soa.esb.actions.ContentBasedRouter
Content based message routing action.
This action supports the following routing rule provider types:
  • XPath: Simple XPath rules, defined inline on the action, or externally in a .properties format file.
  • Drools: Drools rules files (DSL). Out of the box support for an XPath based DSL.
Expand
Table 13.22. ContentBasedRouter Properties
Property Description Required
cbrAlias
Content Based Routing Provider alias. Supported values are "Drools" (default), "Xpath" and "Regex".
ruleSet
Externally defined rule file. It will be a Drools DSL file if the Drools rule provider is in use, or a .properties rule file if the XPath or Regex provider is in use.
ruleLanguage
CBR evaluation Domain Specific Language (DSL) file. Only relevant for the Drools rule provider.
ruleReload
Flag indicating whether or not the rules file should be reloaded each time. Default is “false”.
ruleAuditType
Optional property to have Drools perform audit logging. The log can be read into the Drools Eclipse plugin and inspected. Valid values are CONSOLE, FILE and THREADED_FILE. The default is that no audit logging will be performed.
 
ruleAuditFile
Optional property to define the filepath for audit logging. Only applies to FILE or THREADED_FILE ruleAuditType. The default is "event". Note that JBoss Drools will append ".log" for you. The default location for this file is "." - the current working directory (which for JBoss is in its bin/ directory).
 
ruleAuditInterval
Optional property to define how often to flush audit events to the audit log. Only applies to the THREADED_FILE ruleAuditType. The default is 1000 (milliseconds).
 
destinations
Container property for the <route-to> configurations. If the rules are defined externally, this configuration will have the following format:
<route-to destination-name="express" 
    service-category="ExpressShipping" service-name="ExpressShippingService"/>
Copy to Clipboard Toggle word wrap
If the rules are defined inline in the configuration, this configuration will have the following format (not supported for the Drools provider):
<route-to service-category="ExpressShipping" 
    service-name="ExpressShippingService" expression="/order[@statusCode='2']" />
Copy to Clipboard Toggle word wrap
namespaces
Container property for the <namespace> configurations where required (for example, for the XPath ruleprovider). The <namespace> configurations have the following format:
<namespace prefix="ord" uri="http://acme.com/order" />
Copy to Clipboard Toggle word wrap
Expand
Table 13.23. ContentBasedRouter "process" methods
Property Description Required
process
Do not append aggregation data to the message.
split
Append aggregation data to the message.

Example 13.13. Sample Configuration XPATH (inline)

<action process="split" name="ContentBasedRouter" 
    class="org.jboss.soa.esb.actions.ContentBasedRouter">
    <property name="cbrAlias" value="XPath"/>
    <property name="destinations">
        <route-to service-category="ExpressShipping"                 
            service-name="ExpressShippingService" expression="/order['status='1']" />
        <route-to service-category="NormalShipping"  
            service-name="NormalShippingService" expression="/order['status='2']" />
    </property>  
</action>
Copy to Clipboard Toggle word wrap

Example 13.14. Sample Configuration XPATH (external)

<action process="split" name="ContentBasedRouter" 
    class="org.jboss.soa.esb.actions.ContentBasedRouter">
    <property name="cbrAlias" value="XPath"/>
    <property name="ruleSet" value="xpath-rules.properties"/>
    <property name="ruleReload" value="true"/>
    <property name="destinations">
        <route-to destination-name="express" service-category="ExpressShipping"                 
            service-name="ExpressShippingService"/>
        <route-to destination-name="normal" service-category="NormalShipping"  
            service-name="NormalShippingService"/>
    </property>
</action>
Copy to Clipboard Toggle word wrap
Regex is configured in exactly the same way as XPath. The only difference is the expressions are Regex expressions (instead of XPath expressions).

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat