Hi list,
 I'm using the following aggregation:

<route>
<from uri="seda:aggregation" />
 <!-- aggregate using our strategy and leveldb repo -->
<aggregate strategyRef="rowAggregationStrategy"
 aggregationRepositoryRef="aggregationRepository"
completionFromBatchConsumer="false">
 <!-- correlate by header with the key id -->
<correlationExpression>
<header>aggrId</header>
 </correlationExpression>

<completionPredicate>
<simple>${in.header.complId} == 'END_${exchangeId}'</simple>
 </completionPredicate>
<!-- send aggregated messages to the mock endpoint -->
                <to uri="seda:marshaller" />
 </aggregate>
</route>

When the aggregation may be concluded I send an empty message with the
'complId' set to the expected value but currently I get:

org.apache.camel.CamelExchangeException: Invalid correlation key.
Exchange[test_complete.csv]
at
org.apache.camel.processor.aggregate.AggregateProcessor.doProcess(AggregateProcessor.java:204)
 at
org.apache.camel.processor.aggregate.AggregateProcessor.process(AggregateProcessor.java:179)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)

The question is why the completionPredicate is evaluated after the
aggregation?
At this time I've no 'aggrId' to use (this is only a fake message used as
event).
A possible solution is adding a fake aggrId but I wonder what could be the
right way to solve this case.
I've already tested completionFromBatchConsumer the with no success.

-- 
Dott. Carlo Cancellieri
*skype*: ccancellieri
*Twitter*: @cancellieric
*LinkedIn*: http://it.linkedin.com/in/ccancellieri/



-- 
Dott. Carlo Cancellieri
*skype*: ccancellieri
*Twitter*: @cancellieric
*LinkedIn*: http://it.linkedin.com/in/ccancellieri/

Reply via email to