此内容没有您所选择的语言版本。

11.13. Configuration for Content-Based Routing


  • XPath statements are connected through configuration settings stored in the jboss-esb.xml file. The service configuration below shows an example service configuration fragment. (In this example, the service is listening to a Java Message Service queue.)
    <service> 
            	category="MessageRouting" 
            	name="YourServiceName" 
            	description="CBR Service">
            	<listeners>        
                      <jms-listener name="CBR-Listener"                  
                                busidref="QueueA" maxThreads="1">             
    	           </jms-listener>
                   </listeners>
    		<actions> 
    		     <action class="org.jboss.soa.esb.actions.ContentBasedRouter" 
    		     				     name="YourActionName">
                        	<property name="ruleSet" value="JBossESBRules.drl"/>
                        	<property name="ruleReload" value="true"/>
                        	<property name="destinations">
                               <route-to destination-name="xml-destination" 
    				    service-category="category01" 
    			           service-name="jbossesbtest1" /> 
                               <route-to destination-name="serialized-destination"
                                				           service-category="category02" 
    				    service-name="jbossesbtest2" /> 
                        	</property> 
                        	<property name="object-paths">
    				<object-path esb="body.test1" /> 
    				<object-path esb="body.test2" /> 
    		     	</property>
                        </action>
    		</actions>
                </service>
    
    Copy to Clipboard Toggle word wrap
    Each message is passed to the ContentBasedRouter action class, which is loaded with a certain rule-set. It then sends the message to the JBoss Rules engine's working memory, runs the rules, obtains the list of destinations and sends copies of the message to the services.
    In this case, it uses the JBossESBRules.drl rule-set which matches two destinations- xml-destination and serialized-destination . These names are mapped to those of real services in the route-to section.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat