On Sun, May 25, 2014 at 8:53 PM, Max Bridgewater
<[email protected]> wrote:
> It appears that aggregator is what I was looking for. A small question
> remains. Is there a way to make the route that sends messages to the
> aggregator to block until full aggregation is complete?
>

No. Outgoing messages from the aggregator is routed using a new
thread, and the incoming messages will not block / wait.

But maybe you can use the composed message processor eip, using the
splitter only
http://camel.apache.org/composed-message-processor.html



> Say I have this:
>
>  <route>
>     <from uri="direct:collator"/>
>     <aggregate strategyRef="mergeStrategy" completionSize="5">
>       <correlationExpression>
>         <simple>true</simple>
>       </correlationExpression>
>       <to uri="mock:result"/>
>     </aggregate>
>     <to uri="direct:some-more-processing"/>
>   </route>
>
> What I want is the route direct:some-more-processing to received all 5
> messages after aggregation. Currently, only the last call to this route
> causes the aggregate message to be available at the end.
>
> Thanks.
> Max.
>
>
> On Sun, May 25, 2014 at 5:17 AM, Max Bridgewater
> <[email protected]>wrote:
>
>> Hi,
>>
>> Here is my case. Clients send requests to backend. However, backend does
>> not want to access the database for each client request. Instead, backend
>> wants to poll a queue where client requests are temporarily stored. Backend
>> the fetches a few of these requests, and send them to the database in
>> batch. The response from the database is then sent individually to
>> clients, maybe through separate temporary queues.
>>
>> There are two Camel patterns that I see here: Async request-reply and
>> Polling consumers. However, I struggling to connect the dots.
>>
>> How would you guys go about this?
>>
>> Thanks a lot,
>> Max.
>>
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to