This content has been marked as final.
Show 2 replies
-
1. Re: Content Based routing using drools
ashok_1979 Dec 29, 2008 12:04 AM (in response to neha2911)Neha, i have implemented this using drools.
Here on the basis of message property i am routing my message to different services. Please have a look if it can help you.#created on: Oct 30, 2006 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.Properties; #declare any global variables here global java.util.List destinations; rule "FTPService Rule" when m : Message() props : Properties() from m.getProperties() eval(props.getProperty("CommunicationMode").equals("FTP")) then System.out.println("#########Inside FTPService Rule#########"); destinations.add("FTP-destination"); end rule "SMTPService Rule" when m : Message() props : Properties() from m.getProperties() eval(props.getProperty("CommunicationMode").equals("SMTP")) then System.out.println("#######Inside SMTPService Rule#########"); destinations.add("SMTP-destination"); end
This is the code from jboss-esb.xml<action name="routingAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"> <property name="ruleSet" value="RoutingRules.drl"/> <property name="ruleReload" value="true"/> <property name="destinations"> <route-to destination-name="FTP-destination" service-category="FTPServiceESBCategory" service-name="FTPServiceESB" /> <route-to destination-name="SMTP-destination" service-category="SMTPServiceESBCategory" service-name="SMTPServiceESB" /> </property> </action>
-
2. Re: Content Based routing using drools
marklittle Jan 1, 2009 7:41 AM (in response to neha2911)Don't forget you can always provide code drops for others in the community by putting them in the sandbox.