You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "S. Ali Tokmen" <sa...@bull.net> on 2010/07/26 10:41:58 UTC

Exchange properties not removed

Hello

While in a Pipeline, new Exchanges are created for each Processor. At 
the end of the Pipeline, the main Exchange is updated with values from 
the latest created Exchange.
Here is the executed block of code:

    if (source.hasProperties()) {
       result.getProperties().putAll(source.getProperties());
    }

As we can see, if the source Exchange was removed of some properties, 
the property disappearance will never made it into the result Exchange.

Is this expected?

Cheers

-- 

S. Ali Tokmen
savas-ali.tokmen@bull.net

Office: +33 4 76 29 76 19
GSM:    +33 66 43 00 555

Bull, Architect of an Open World TM
http://www.bull.com


Re: Exchange properties not removed

Posted by "S. Ali Tokmen" <sa...@bull.net>.
Hello

Thank you for the information

S. Ali Tokmen
savas-ali.tokmen@bull.net

Office: +33 4 76 29 76 19
GSM:    +33 66 43 00 555

Bull, Architect of an Open World TM
http://www.bull.com


On 26/07/2010 11:00, Claus Ibsen wrote:
> On Mon, Jul 26, 2010 at 10:41 AM, S. Ali Tokmen
> <sa...@bull.net>  wrote:
>    
>> Hello
>>
>> While in a Pipeline, new Exchanges are created for each Processor. At the
>> end of the Pipeline, the main Exchange is updated with values from the
>> latest created Exchange.
>> Here is the executed block of code:
>>
>>    if (source.hasProperties()) {
>>       result.getProperties().putAll(source.getProperties());
>>    }
>>
>> As we can see, if the source Exchange was removed of some properties, the
>> property disappearance will never made it into the result Exchange.
>>
>> Is this expected?
>>
>>      
> Yes Camel uses a defensive copy of the Exchange while routing.
>
> This will change in the future (Camel 3.0 or maybe a bit earlier) as
> we want to rework this a bit to only copy on demand.
> The API changes in Camel 2.0 was the first step in this direction.
>
>
>
>    
>> Cheers
>>
>> --
>>
>> S. Ali Tokmen
>> savas-ali.tokmen@bull.net
>>
>> Office: +33 4 76 29 76 19
>> GSM:    +33 66 43 00 555
>>
>> Bull, Architect of an Open World TM
>> http://www.bull.com
>>
>>
>>      
>
>
>    


Re: Exchange properties not removed

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jul 26, 2010 at 10:41 AM, S. Ali Tokmen
<sa...@bull.net> wrote:
> Hello
>
> While in a Pipeline, new Exchanges are created for each Processor. At the
> end of the Pipeline, the main Exchange is updated with values from the
> latest created Exchange.
> Here is the executed block of code:
>
>   if (source.hasProperties()) {
>      result.getProperties().putAll(source.getProperties());
>   }
>
> As we can see, if the source Exchange was removed of some properties, the
> property disappearance will never made it into the result Exchange.
>
> Is this expected?
>

Yes Camel uses a defensive copy of the Exchange while routing.

This will change in the future (Camel 3.0 or maybe a bit earlier) as
we want to rework this a bit to only copy on demand.
The API changes in Camel 2.0 was the first step in this direction.



> Cheers
>
> --
>
> S. Ali Tokmen
> savas-ali.tokmen@bull.net
>
> Office: +33 4 76 29 76 19
> GSM:    +33 66 43 00 555
>
> Bull, Architect of an Open World TM
> http://www.bull.com
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus