camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <>
Subject Re: Should we (could we?) make Exchanges serializable?
Date Sat, 09 Oct 2010 05:54:25 GMT

That's the gist of it, yes. You have to decide if you want to marshal the properties as well.

You are correct. The problem (stated another way) is that the exchange itself has no semantic
outside of it's context, so what the holder does is to extract from the exchange the elements
that are relevant by themselves, bundle them together (including the exchange id for correlation
if needed) and serialize them. Probably not the most intuitive of names, but that's the purpose
it serves.


On Oct 8, 2010, at 4:18 PM, Christian Müller wrote:

> I'm the camel user Ade is working with. :o)
> If I understood correct, we should code something like this on the sender
> side (we use Camel 2.2):
> Serializable holder = DefaultExchangeHolder.marshal(exchange);
> exchange.getIn().setBody(holder);
> and on the receiver side:
> holder = exchange.getIn().getBody(DefaultExchangeHolder.class);
> DefaultExchangeHolder.unmarshal(exchange, holder);
> I'm right?
> @Hadrian: Make the Exchange serializable is a problem because the exchange
> has references to the hole Camel context and many other objects (which are
> not serializable) or is there another reason?
> Thanks,
> Christian

View raw message