You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/01/16 08:46:36 UTC
[jira] [Commented] (CAMEL-8246) ZipAggregationStrategy does not
preserve headers
[ https://issues.apache.org/jira/browse/CAMEL-8246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14279934#comment-14279934 ]
Claus Ibsen commented on CAMEL-8246:
------------------------------------
The aggregation strategy should not create a new exchange but reuse the existing. This is what others do, and also preservers the headers/properties from the 1st incoming exchange
> ZipAggregationStrategy does not preserve headers
> ------------------------------------------------
>
> Key: CAMEL-8246
> URL: https://issues.apache.org/jira/browse/CAMEL-8246
> Project: Camel
> Issue Type: Improvement
> Affects Versions: 2.14.0
> Reporter: Chris Pimlott
> Assignee: Claus Ibsen
> Priority: Minor
> Labels: camel-zipfile
> Fix For: 2.14.2, 2.15.0
>
>
> 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:
> {code:xml}
> <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>
> {code}
> 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.
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)