You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Andersson Wigander <mi...@gmail.com> on 2020/04/01 13:08:49 UTC

Aggregation problem with grouped messages

Hi

Been struggling with this for a long time now and I can’t seem to get it right.

I process transactions from a JMS queue, +10000/24h. 

I need to aggregate them before sending them further down the chain.

When ever I receive a transaction with the same transactionNumber I have to check what has changed and update or replace the aggregated transaction.

On timeout or size I flush all transactions out to produce a file for further processing.

I have tried to put logic in my custom ListAggregationStrategy class where I loop thru and do the duplicate check but this is not a good approach when we have +10.000 transactions in aggregation using id as constant(true).

Tried to aggregate on id “transactionNumber” but when I flush I get one message for each aggregated transaction which is not what I want. I want a list of transactions I can process.

Tried “GroupedAggregationStrategies" but can’t really understand how to use it properly. Nothing found when searching for it either.

So the question is:

How can I get a List of transactions when flushed out after aggregation if each aggregated transaction is on id “transactionNumber”?


groupedExchanges is deprecated and cannot be used if that would be an answer…

Using Camel 2.25.0 on Spring Boot, Java DSL

Thx

/_frustrated_