[
https://issues.apache.org/jira/browse/CAMEL-8423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14346442#comment-14346442
]
Claus Ibsen commented on CAMEL-8423:
------------------------------------
The solution was the last.
There is a new property you can set in the aggregation strategy on the returned
exchange to true.
The name is Exchange.AGGREGATION_COMPLETE_CURRENT_GROUP. (eg all the names in
Camel are stored on Exchange)
> Enhance AggregationStrategy to allow it to determine if aggregation is
> complete
> -------------------------------------------------------------------------------
>
> Key: CAMEL-8423
> URL: https://issues.apache.org/jira/browse/CAMEL-8423
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Daniel Kulp
> Assignee: Daniel Kulp
> Fix For: 2.15.0
>
>
> Currently, the Aggregation component allows the completion to be triggered on
> either a Timeout, a set number of aggregations, or via use of a Predicate to
> determine the completion. In some cases the AggregationStrategy itself may
> be the best place to determine if the aggregation is complete.
> One example: adding a "data size limit" as the trigger. The aggregation
> component has no concept of the "size" of the data (nor should it) as it's
> the AggregationStrategy object that handles the actual aggregation of the
> data. If during the Aggregating of the exchanges if a size limit (or other
> limit) is achieved, it would be good to be able to flag the exchange as ready.
> This can be somewhat done as a predicate that looks at the aggregated
> exchange and looks at the size. However, this requires the user to
> implement two objects and configure two things for the aggregator. One
> proposal would be that if the user supplied AggregationStrategy implements
> Predicate and no completionPredicate is supplied, the given
> AggregationStrategy is also set as the completionPredicate. Similarly, a
> new interface could be introduced for this if using Predicate is a concern.
> Another strategy would be to set a property on the returned exchange during
> aggregation that would mark it as "done" and have the Aggregator look for
> that property.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)