Hi,

I have a need to invoke multiple endpoints from a loop and then aggregate the 
results and return that to a caller. I tried using multicast with a predefined 
set of endpoints, and I can get it working with an aggregation strategy. Since 
the endpoints are dynamic, I switched to using a loop, however, it seems to be 
returning the result of only the last invocation. The route definition is shown 
below.


<bean id="aggregatorStrategy" 
class="org.apache.camel.processor.aggregate.GroupedMessageAggregationStrategy" 
/>

<bean id="echoService" class="foo.EchoService" />

<camelContext xmlns="http://camel.apache.org/schema/spring";>
    <route>
        <from uri="direct:inbound"/>

        <!--multicast strategyRef="aggregatorStrategy">

            <bean ref="echoService" method="echo" />
            <bean ref="echoService" method="echo" />
        </multicast-->
        <loop>
            <constant>2</constant>
            <bean ref="echoService" method="echo" />
        </loop>
        <to uri="direct:outbound"/>
    </route>
</camelContext>


Kind regards
Meeraj
The information transmitted, including any content in this communication is 
confidential, is intended only for the use of the intended recipient and is the 
property of the Western Union Company or its affiliates and subsidiaries. If 
you are not the intended recipient, you are hereby notified that any use of the 
information contained in or transmitted with the communication or 
dissemination, distribution, or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify the 
Western Union sender immediately by replying to this message and delete the 
original message

Reply via email to