Hi,

When using akka-camel, I try to use only the camel endpoints and rely on 
akka for everything else. This way you get all the benefits of both worlds, 
the awesome amount of endpoints camel can connect to, and the nice 
programming model and powerful concepts Akka provides. For aggregation 
there is currently a pattern in the contrib package 
(http://doc.akka.io/docs/akka/2.3.0/contrib/aggregator.html), however it is 
only available in Scala. You can build an aggregator yourself though, and 
it is not that hard. After all you can model this using one actor which 
will receive all messages that need to be aggregated. You need to provide a 
timeout to handle failures, and have can handle everything as you like. 
This is a much more flexible approach. The Akka In Action book by Ray 
Roestenburg (http://www.manning.com/roestenburg/), currently available as a 
preview, contains a possible implementation of an aggregator (in scala 
again, but easily transferable to Akka).

It is worth mentioning that you can still use camel routes when using 
akka-camel. The two actors provided by akka-camel, Producer and Consumer, 
are the points at which you connect the camel and the akka world. BUT, I 
would avoid putting too much of your logic into the camel part, like 
written before, I think the main benefit of akka-camel is that you can make 
use of the camel endpoints. Everything else I would do in Akka.

HTH

Cheers,
Michael

Am Dienstag, 24. Juni 2014 05:32:08 UTC+2 schrieb [email protected]:
>
> Hi All,
>
> In camel there is aggregate pattern. 
>
> Sample code as below
> <aggregate strategyRef="aggregatorStrategy"
> completionInterval="5000" completionSize="100" 
> forceCompletionOnStop="true">
> <correlationExpression>
> <simple>header.aggregatorId</simple>
> </correlationExpression> 
>                         <to uri="testProcessor"/>
> </aggregate>
>
> Somebody could tell me how  to use akka-camel to implement aggregate  in 
> java? thanks
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to