camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Large objects in headers and endpoints?
Date Mon, 21 Oct 2013 09:17:39 GMT

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

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

On Fri, Oct 18, 2013 at 9:00 PM, Keith Freeman <> 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.
Twitter: davsclaus
Author of Camel in Action:

View raw message