Author: davsclaus
Date: Wed Feb 27 12:00:17 2013
New Revision: 1450754
URL: http://svn.apache.org/r1450754
Log:
CAMEL-6042: Fixed aggregator to set the correlated key on the exchange
properties before removing, as its needed by custom aggregation repositories to
be presented before remove is called.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java?rev=1450754&r1=1450753&r2=1450754&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
Wed Feb 27 12:00:17 2013
@@ -416,12 +416,15 @@ public class AggregateProcessor extends
}
protected void onCompletion(final String key, final Exchange original,
final Exchange aggregated, boolean fromTimeout) {
+ // store the correlation key as property before we remove so the
repository has that information
+ if (original != null) {
+ original.setProperty(Exchange.AGGREGATED_CORRELATION_KEY, key);
+ }
+ aggregated.setProperty(Exchange.AGGREGATED_CORRELATION_KEY, key);
+
// remove from repository as its completed, we do this first as to
trigger any OptimisticLockingException's
aggregationRepository.remove(aggregated.getContext(), key, original);
- // store the correlation key as property
- aggregated.setProperty(Exchange.AGGREGATED_CORRELATION_KEY, key);
-
if (!fromTimeout && timeoutMap != null) {
// cleanup timeout map if it was a incoming exchange which
triggered the timeout (and not the timeout checker)
timeoutMap.remove(key);