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

Processor for .pollEnrich incorrectly handles provided AggregationStrategy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 2.14.3
    • None
    • camel-core
    • None
    • Unknown

    Description

      As it can be concluded from AggregationStrategy javadoc, and also from available implementations such as GroupedExchangeAggregationStrategy, it should be used in the following manner:

      AggregationStrategy strategy = new GroupedExchangeAggregationStrategy();
      
      Exchange result = null;
      result = strategy.aggregate(result, exchange1);
      result = strategy.aggregate(result, exchange2);
      // ... and so on
      return result;
      

      But PollEnricher do it in following manner:

      AggregationStrategy strategy = new GroupedExchangeAggregationStrategy();
      
      Exchange result = strategy.aggregate(exchange1, exchange2);
      return result;
      

      This leads to incorrect result returned after aggregation and lost exchanges.

      Also PollEnricher doesn't handle CompletionAwareAggregationStrategy and does not call onCompletion(). Consequently GroupedExchangeAggregationStrategy does not return aggregated result in the Exchange body.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            andy.fedotov Andy Fedotov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: