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

Processor for .pollEnrich incorrectly handles provided AggregationStrategy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.14.3
    • Fix Version/s: None
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: