camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Kalukiewicz" <roman.kalukiew...@gmail.com>
Subject Re: a MinaExchange suddenly becomes a DefaultExchange?
Date Wed, 24 Dec 2008 12:04:36 GMT
2008/12/24 Willem Jiang <willem.jiang@gmail.com>

> Hi,
>
> I don't think remove the IoSession from exchange of Mina will save the
> copy of messages. The copied exchange just hold the reference of the
> IoSession.
> For the user , they may use more than one processors to handle the
> MinaExchange to make up a response message. I'd like to revert the
> custom exchange changes in Camel 2.0.
>
> Any thought?


I totally agree that we should revert it or maybe change it so we don't
loose functionality.

What I was using this feature for is retrieving some protocol specific
information from embedded object like JBI exchange. The problem was that
after first step of processing JbiExchange turn into DefaultExchange so if
you want to do something you have to do it in one step.

Moreover strange things happen when you work on headers. getHeader("foo")
returns a header from JbiMessage, but getHeaders() look only inside of
DefaultMessage.

I believe a good solution would be to remove custom exchanges but add
protocol specific message (if applies) to default camel exchange as a
header/property/custom field in the message/exchange.

This way when you set headers or body, you don't have to synchronize with
original thing (that might not support everything camel support), but you
have a chance to retrieve original message (and you have to care about
synchronization issues then if you modify it).

Romek


>
> Willem
> Trevv wrote:
> >
> > James.Strachan wrote:
> >> In trunk we've removed alot of the custom Exchange implementations (as
> it
> >> was resulting in an extra copy of messages). So no I don't think its
> bug.
> >
> > I forgot to mention that I'm using version 1.5, not the 2.0 trunk.
> >
> > In 1.5, this does appear to be a bug.
> >
> > In this 3rd-party manual:
> >
> http://fusesource.com/docs/router/1.5/prog_guide/Component-Impl-Exchange.html
> >
> > I found this advice:
> >
> > The newInstance() method is overridden, to ensure that the
> > DefaultExchange.copy() method works properly.
> >
> > I followed that advice, and it solved my problem.
> >
> > Patch available here:
> > https://issues.apache.org/activemq/browse/CAMEL-1202
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message