camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <>
Subject Re: Faster!!
Date Thu, 09 Jul 2009 14:50:30 GMT
I hardly see a reason for the IN message to be mutable.  Shouldn't it  
be read-only to start with?
In my mind the IN is what you've been told, it's history, cannot be  
changed.  If you want to echo something slightly different, you can  
always produce the OUT you want (modified copy of the IN).

+1 on both counts.  Properties are used in quite a few places now  
though, mostly for components that use bindings, like Jms, File, Mail,  
etc.  However I don't think copying properties is very expensive, plus  
we could optimize that a bit in 2.x.


On Jul 9, 2009, at 6:35 AM, James Strachan wrote:

> 2009/7/9 Claus Ibsen <>:
>> Hi
>> See this wiki page for ideas on performance optimizations
> Copying Messages seems to be the big cost (particularly all those  
> headers etc).
> I wonder if we should use in the Pipeline a ReadOnlyMessageFacade
> which prevents mutation of the underlying message, so the same Message
> can be reused (no need to make defensive copies first) and can be
> passed into next steps in the chain if an OUT message is not created?
> I'm also wondering how often we really use Exchange properties; seems
> we mostly use message headers; in which case creating new Exchange
> instances should be quite cheap - as we can just pass the IN by value
> each time?
> -- 
> James
> -------
> Open Source Integration

View raw message