Hi

Yeah the Camel routing engine does shallow copies by default. Though
some EIPs support a onPrepare option you can configure with a custom
processor, where you can implement logic to do deep copy of you really
need it.

You mind that if you use remote transports such as HTTP based etc then
you may not want to send that hashmap of headers over HTTP, which you
then would need to filter out / remove the header before sending over
HTTP.

But for internal routing with direct/seda then no problem.



On Fri, Oct 18, 2013 at 9:00 PM, Keith Freeman <[email protected]> wrote:
> Hello all,
>
> I'm considering a design where (in Java DSL) a component in my route would
> create a large object (a hashmap with thousands of entries totaling a few MB
> in size) and stick it in a header.  Then other components along the route
> would be able to access it for lookups and modifications.
>
> My question is whether I need to worry about performance with this design,
> assuming I keep the entire route within a single JVM?
>
> I do use direct:, direct-vm:, seda: and vm: endpoints in my routes, but my
> understanding is that all of these (including the header) will simply pass
> this along as an object reference, never making an copies or serializing it.
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to