camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" <claus.ib...@gmail.com>
Subject Re: a MinaExchange suddenly becomes a DefaultExchange?
Date Sun, 28 Dec 2008 12:00:13 GMT
On Wed, Dec 24, 2008 at 1:04 PM, Roman Kalukiewicz
<roman.kalukiewicz@gmail.com> wrote:
> 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.
+1

>
> 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).
Hadrian had some ideas to this. Having Exchange begin final and only
add protocol specific stuff to the message instead.
I kinda liked this as the API is IMHO a bit to complex.

We have a thread discussing this somewhere. And James had some good
pointers as well.

Maybe we need to pick it up again now that we have the change to craft
the 2.0 API

>
> 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
>>
>>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Mime
View raw message