Can someone answer pls?
search ESB Services Guide for object-paths (http://docs.jboss.org/jbossesb/docs/4.8/manuals/html/ServicesGuide.html). You can map your message property to be validated against defined rules. I'd better use regexp router for your simple scenario.
SOA Platform QE
JBoss by RedHat
Could also look at extending the ContentBasedWiretap class, injecting a new implementation of the ContentBasedRouter interface (or its abstract impl AbstractPropertyRulesRouter).
Thanks for the reply.
I'm sorry for coming up with same question. althogh have tried the instructions provided in the guides couldn't make it to work.
below is my service configuration
<service category="MyFirstCBRServicesESB" description="ESB Listener" name="FirstCBRServiceESB">
<jms-listener busidref="quickstartGwChannel" is-gateway="true" name="the-gateway"/>
<jms-listener busidref="quickstartEsbChannel" name="XPathContentBasedRouter"/>
<action class="org.jboss.soa.esb.samples.quickstart.simplecbr.TestAction" name="test"/>
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
<property name="cbrAlias" value="Regex"/>
<route-to service-category="ExpressShipping" service-name="ExpressShippingService" expression="?" />
<route-to service-category="NormalShipping" service-name="NormalShippingService" expression="#*222#*" />
<object-path esb="properties.subscriptionAction" />
Could you pls give me the sample regex rules for interpreting message properties? in my problem, need to write a regex rules such that will evaluate the subscriptionAction feild for routing logic. (ADD,REMOVE,REPLACE,REMOVE and MODIFY are the possible values)
I actually work arounded the problem or lack of understanding on JBOSS CBR rules by writing a simple service where i could interpret the the subscriptionAction and route the message to a service which is interested in it using ServiceInvoker, however going forward and in the long run for more flexibility thinking to use the framework support extensively.
I don't understand what is the problem with the following routes definitions:
<route-to service-category="ExpressShipping" service-name="ExpressShippingService" expression=".*ADD.*" />
<route-to service-category="NormalShipping" service-name="NormalShippingService" expression=".*MODIFY.*" />
<route-to service-category="NormalShipping" service-name="NormalShippingService" expression=".*REPLACE.*" />
<route-to service-category="NormalShipping" service-name="NormalShippingService" expression=".*REMOVE.*" />
Why cannot that work for you?
Thanks again for reply.
It says when tried the Regex expressions sent by you.
17:24:50,639 ERROR [ContentBasedWiretap] No rule destination(s) [ExpressShipping-ExpressShippingService, NormalShipping-NormalShippingService] were matched, . Please fix your configuration and/or routing rules.
here the point I don't understand is, how are we instructing Regex rules executor to interpret the subscriptionAction property (is it thru object-path)
eventually, I managed to get to it and here is the cause of your troubles: https://jira.jboss.org/browse/JBESB-3389
This affects RegEx, and XPath. Drools routing is still fine. So you can use object-path to put a message property into the working memory ang get to it in your rules.