[jboss-dev-forums] [Design of JBoss ESB] - Problem in Content Based Routing
Neha29
do-not-reply at jboss.com
Mon Aug 11 00:54:18 EDT 2008
I want to perform Content Based Routing. I want to give my custom object for the rules to execute the action.I am sending a serialized java object using jms .
But i am unable to get the right output.
My JBossesb.xml snippet is
|
| <services>
| <!-- ESB CBR Service -->
| <service category="MyFirstCBRServicesESB" description="ESB Listener" name="FirstCBRServiceESB">
| <listeners>
| <!-- Gateway -->
| <jms-listener busidref="quickstartGwChannel" is-gateway="true"
| maxThreads="1" name="the-gateway"/>
| <jms-listener busidref="quickstartEsbChannel" maxThreads="1" name="XPathContentBasedRouter"/>
| </listeners>
| <actions mep="OneWay">
| <action name="print" class="org.jboss.soa.esb.actions.SystemPrintln">
| <property name="message"
| value="Message beforeeee Routing"/>
| </action>
| <action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
| <property name="destinations">
| <route-to destination-name="express"
| service-category="ExpressShipping" service-name="ExpressService"/>
| <route-to destination-name="normal"
| service-category="NormalShipping" service-name="NormalService"/>
| <route-to destination-name="test"
| service-category="Test" service-name="TestService"/>
| </property>
| <property name="ruleReload" value="true"/>
| <property name="ruleSet" value="SimpleCBRRules"/>
| <property name="object-paths">
| <object-path esb="body.Task" />
| </property>
|
| </action> </actions>
| </service>
My Rule file is
|
| package com.jboss.soa.esb.routing.cbr
|
| #list any import classes here.
| import org.jboss.soa.esb.message.Message;
| import org.jboss.soa.esb.message.format.MessageType;
| import task.Task;
|
| //expander XPathLanguage.dsl
|
| #declare any global variables here
| global java.util.List destinations;
|
| rule "Routing Rule using XPATH"
|
| when
| t : Task(status == 1)
|
| then
| System.out.println("EXPRESS");
| destinations.add("express");
|
|
| end
|
| rule "Routing Rule using XPATH less"
| when
| t:Task(status == 2 )
|
| then
|
| System.out.println("NORMAL");
| destinations.add("normal");
|
| end
|
| rule "Routing Rule using XPATH test"
| when
| t:Task(status == 3)
|
| then
| System.out.println("TEST");
| destinations.add("test");
|
| end
|
Iam sending a Task object with the status member defined to the queue but iam not able to find the desired output.
How to go about it ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169775#4169775
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169775
More information about the jboss-dev-forums
mailing list