StaticRouter and Aggregator
haagenhasle Oct 1, 2007 10:13 AMHi!
I'm fairly new to JBoss ESB, and I need some help with routing and aggregating my messages. I hope someone here can help me.
I'm trying to the following:
I'm exposing a webservice that connects to the ESB. Inside the ESB, I route (split) the message to two different services. These services both return a Customer (I'm doing some transformations so that they both return the same class.) I'd like to use an Aggregator to "merge" these two Customers into one, but it appears the Aggregator is never called.
My configuration looks like this (modified to be easier to read):
---
<service category="CustomerCategory" name="CustomerSearch" description=".."> <listeners> <jms-listener name="JMS-CustomerSearchListener" busidref="..." maxThreads="1" /> </listeners> <actions> <action name="splitTheSearch" class="org.jboss.soa.esb.actions.StaticRouter" process="split"> <property name="destinations"> <route-to service-category="CustomerCategory" service-name="Customer1" /> <route-to service-category="CustomerCategory" service-name="Customer2" /> </property> </action> <action name="aggregateTheResults" class="org.jboss.soa.esb.actions.Aggregator"> <property name="timeoutInMillies" value="60000" /> </action> <action name="transformTwoCustomersToOne" class="..." process="..."> </action> </actions> </service> <service category="CustomerCategory" name="Customer1" description=".."> <listeners> <jms-listener name="JMS-Customer1Listener" busidref="..." maxThreads="1" /> </listeners> <actions> <action name="transformBeforeFor" class="..." process="..."> </action> <action name="doSomethingThatReturnsACustomer1" class="..." /> <action name="transformAfter" class="..." process="..." /> </actions> </service> <service category="CustomerCategory" name="Customer2" description=".."> <listeners> <jms-listener name="JMS-Customer2Listener" busidref="..." maxThreads="1" /> </listeners> <actions> <action name="transformBeforeFor" class="..." process="..." /> <action name="doSomethingThatReturnsACustomer2" class="..." /> <action name="transformAfter" class="..." process="..." /> </actions> </service>
---
The StaticRouter successfully routes the messages to the two different services, but the Aggregator is never used. What am I doing wrong?
When I read about routing and aggregating in the documentation and the samples, it is a bit difficult to understand what to do. One place I read that process="splitt" is no longer necessary, but another place it says that this is what makes the Aggregator work.
Best regards, Haagen