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?
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.
>
>