Este conteúdo não está disponível no idioma selecionado.

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>
    
    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

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo