camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Keller (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-7555) ZipAggregationStrategy does not preserve properties
Date Fri, 04 Jul 2014 13:02:33 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-7555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14052424#comment-14052424
] 

Peter Keller commented on CAMEL-7555:
-------------------------------------

It's expected that properties are accessible during the *entire* lifetime of the {{Exchange}}
object. From the JavaDoc of [Exchange|http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html]:

{quote}
The Exchange also holds meta-data during its *entire* lifetime stored as properties accessible
using the various getProperty(String) methods.
{quote}

Why not copy just all properties as this is be done everywhere else?

> ZipAggregationStrategy does not preserve properties
> ---------------------------------------------------
>
>                 Key: CAMEL-7555
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7555
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.13.1
>            Reporter: Peter Keller
>            Assignee: Willem Jiang
>
> {{ZipAggregationStrategy}} does not preserve properties:
> {code}
> public class MyRouteBuilder extends RouteBuilder {
>     @Override
>     public void configure() {
>         from("file:zipper/in?include=.*.xml&noop=true")
>             .process(new Processor() {
>                 @Override
>                 public void process(final Exchange exchange) throws Exception {
>                     exchange.setProperty("myProperty", "myValue");
>                 }
>             })
>             .aggregate(new ZipAggregationStrategy())
>             .constant(true)
>             .completionFromBatchConsumer()
>             .eagerCheckCompletion()
>             .log("myProperty = ${property.myProperty}")
>             .to("file:zipper/out");
>     }
> }
> {code}
> This logs:
> {quote}
> myProperty = 
> {quote}
> Instead it should log:
> {quote}
> myProperty = myValue
> {quote}
> See http://stackoverflow.com/questions/24473035/how-to-access-calling-exchange-with-camels-zipaggregationstrategy



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message