Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8423

Enhance Aggregate EIP to let AggregationStrategy to allow it to determine if aggregation is complete

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Implemented
    • None
    • 2.15.0
    • camel-core
    • None
    • Unknown

    Description

      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.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            dkulp Daniel Kulp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: