-
1. Re: Content based routing - using message property
skumarraju Jun 9, 2010 1:11 AM (in response to skumarraju)Can someone answer pls?
-
2. Re: Content based routing - using message property
mvecera Jun 9, 2010 5:08 AM (in response to skumarraju)Hello Shravan,
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.
Regards,
Martin Vecera
SOA Platform QE
JBoss by RedHat
-
3. Re: Content based routing - using message property
tfennelly Jun 9, 2010 5:13 AM (in response to skumarraju)Could also look at extending the ContentBasedWiretap class, injecting a new implementation of the ContentBasedRouter interface (or its abstract impl AbstractPropertyRulesRouter).
-
4. Re: Content based routing - using message property
skumarraju Jun 9, 2010 6:34 AM (in response to mvecera)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">
<listeners>
<jms-listener busidref="quickstartGwChannel" is-gateway="true" name="the-gateway"/>
<jms-listener busidref="quickstartEsbChannel" name="XPathContentBasedRouter"/>
</listeners>
<actions mep="OneWay">
<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"/>
<property name="destinations">
<route-to service-category="ExpressShipping" service-name="ExpressShippingService" expression="?" />
<route-to service-category="NormalShipping" service-name="NormalShippingService" expression="#*222#*" />
</property>
<property name="object-paths">
<object-path esb="properties.subscriptionAction" />
</property>
</action>
</actions>
</service>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)
-
5. Re: Content based routing - using message property
skumarraju Jun 9, 2010 6:43 AM (in response to skumarraju)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.
-
6. Re: Content based routing - using message property
mvecera Jun 9, 2010 7:45 AM (in response to skumarraju)Hello,
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?
Martin
-
7. Re: Content based routing - using message property
skumarraju Jun 9, 2010 7:59 AM (in response to mvecera)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)
-Shravan
-
8. Re: Content based routing - using message property
mvecera Jul 26, 2010 2:37 PM (in response to skumarraju)Hello,
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.
Martin