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

ZipAggregationStrategy does not preserve headers

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.14.0
    • 2.14.2, 2.15.0
    • None
    • Unknown

    Description

      ZipAggregationStrategy does not preserve any headers from the aggregated exchanges. This makes it difficult to do something like name the output zip file based on the correlation key:

          <from uri="direct:input"/>
          <aggregate strategyRef="zipStrategy" eagerCheckCompletion="true">
            <correlationExpression>
              <simple>${header[batchId]}</simple>
            </correlationExpression>
            <completionSize>
              <simple>${header[batchSize]}</simple>
            </completionSize>
            <setHeader headerName="CamelFileName">
              <simple>batch-${header[batchId]}.zip</simple>
            </setHeader>
            <to uri="direct:output"/>
          </aggregate>
      

      This behavior is inconsistent with other existing AggregationStrategies, including AggregationStrategyBeanAdapter, FlexibleAggregationStrategy, UseLatestAggregationStrategy, and UseOriginalAggregationStrategy, which all use the first exchange received (or a copy of it) to initialize the aggregated exchange, hence preserving headers and properties, including those which may used to determine the correlation of related exchanges.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              pimlottc Chris Pimlott
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: