You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Wilson <wi...@gmail.com> on 2009/11/16 17:28:48 UTC

Re: Aggregator message lost

Hi Claus,

I was out on vacation so my feedback is a bit late.

I figured out why my code is not working.

Your AggregationStrategy implementation is setting the message body this
way:
  oldExchange.getIn().setBody(oldBody + "," + newBody);

My code is doing this:
  oldExchange.getOut().setBody(oldBody + "," + newBody);

I am used to the Processor interface that expects the body to be set in the
"out exchange". It is strange the fact that the Aggregation Strategy expects
the "in exchange" to be updated.

Thank you.

--
Wilson Freitas
Vetta Technologies
http://www.vettatech.com



Claus Ibsen-2 wrote:
> 
> Hi
> 
> See this unit test which I have created that works.
> http://svn.apache.org/viewvc?rev=828961&view=rev
> 
> 
> On Wed, Oct 21, 2009 at 8:15 PM, Wilson <wi...@gmail.com> wrote:
>>
>> Hi Claus,
>>
>> Thanks for your answer.
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> Do you "loose" message every time you run the unit test?
>>>
>>> Have you tried with a higher batch timeout?
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>> Yes. The "message lost" happens every time I run the code. I think the
>> problem is not related to batchTimeout. BTW increasing the batchTimeout
>> to
>> 100 secs has no effect. As you can see in the logs, the messages are
>> produced very quickly and all of then are passing through the Aggregator.
>>
>> Looks like the exchange produced by the Aggregator is the one created
>> when
>> the message n-1 is aggregated. I am not sure, but I think the exchange
>> returned by the last aggregator cycle is being ignored.
>>
>> This is what I think is happening:
>>
>> For n messages:
>> -->Exchange(1)--Aggregator-->AggregatedExchange(1)-->
>> -->Exchange(2),AggregatedExchange(1)-->Aggregator-->AggregatedExchange(2)-->
>> -->Exchange(3),AggregatedExchange(2)-->Aggregator-->AggregatedExchange(3)-->
>> ...
>> -->Exchange(n-1),AggregatedExchange(n-2)-->Aggregator-->AggregatedExchange(n-1)-->(this
>> one is produced by the aggregator)
>> -->Exchange(n),AggregatedExchange(n-1)-->Aggregator-->AggregatedExchange(n)-->(this
>> one is being lost or ignored somehow)
>>
>> Thank you,
>>
>> --
>> Wilson Freitas
>> Vetta Technologies
>> http://www.vettatech.com
>> --
>> View this message in context:
>> http://www.nabble.com/Aggregator-message-lost-tp25976380p25997564.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Aggregator-message-lost-tp25976380p26374868.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator message lost

Posted by Willem Jiang <wi...@gmail.com>.
Since Camel is using Pipeline to chain to endpoints together, the out 
message which comes from first endpoint will be treat as in message for 
the second endpoint; if there is on out message that be set to exchange 
from first endpoint, second endpoint can still can get the in message 
from first endpoint :)

Willem

Wilson wrote:
> Hi Claus,
> 
> I was out on vacation so my feedback is a bit late.
> 
> I figured out why my code is not working.
> 
> Your AggregationStrategy implementation is setting the message body this
> way:
>   oldExchange.getIn().setBody(oldBody + "," + newBody);
> 
> My code is doing this:
>   oldExchange.getOut().setBody(oldBody + "," + newBody);
> 
> I am used to the Processor interface that expects the body to be set in the
> "out exchange". It is strange the fact that the Aggregation Strategy expects
> the "in exchange" to be updated.
> 
> Thank you.
> 
> --
> Wilson Freitas
> Vetta Technologies
> http://www.vettatech.com
> 
> 
> 
> Claus Ibsen-2 wrote:
>> Hi
>>
>> See this unit test which I have created that works.
>> http://svn.apache.org/viewvc?rev=828961&view=rev
>>
>>
>> On Wed, Oct 21, 2009 at 8:15 PM, Wilson <wi...@gmail.com> wrote:
>>> Hi Claus,
>>>
>>> Thanks for your answer.
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>> Hi
>>>>
>>>> Do you "loose" message every time you run the unit test?
>>>>
>>>> Have you tried with a higher batch timeout?
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>> Yes. The "message lost" happens every time I run the code. I think the
>>> problem is not related to batchTimeout. BTW increasing the batchTimeout
>>> to
>>> 100 secs has no effect. As you can see in the logs, the messages are
>>> produced very quickly and all of then are passing through the Aggregator.
>>>
>>> Looks like the exchange produced by the Aggregator is the one created
>>> when
>>> the message n-1 is aggregated. I am not sure, but I think the exchange
>>> returned by the last aggregator cycle is being ignored.
>>>
>>> This is what I think is happening:
>>>
>>> For n messages:
>>> -->Exchange(1)--Aggregator-->AggregatedExchange(1)-->
>>> -->Exchange(2),AggregatedExchange(1)-->Aggregator-->AggregatedExchange(2)-->
>>> -->Exchange(3),AggregatedExchange(2)-->Aggregator-->AggregatedExchange(3)-->
>>> ...
>>> -->Exchange(n-1),AggregatedExchange(n-2)-->Aggregator-->AggregatedExchange(n-1)-->(this
>>> one is produced by the aggregator)
>>> -->Exchange(n),AggregatedExchange(n-1)-->Aggregator-->AggregatedExchange(n)-->(this
>>> one is being lost or ignored somehow)
>>>
>>> Thank you,
>>>
>>> --
>>> Wilson Freitas
>>> Vetta Technologies
>>> http://www.vettatech.com
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Aggregator-message-lost-tp25976380p25997564.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
> 


Re: Re: Aggregator message lost

Posted by br...@gmail.com.
Maybe it will make sense if you consider the aggregation is been done over  
incoming messages.


Cheers,
Bruno

On Nov 16, 2009 2:28pm, Wilson <wi...@gmail.com> wrote:


> Hi Claus,



> I was out on vacation so my feedback is a bit late.



> I figured out why my code is not working.



> Your AggregationStrategy implementation is setting the message body this

> way:

> oldExchange.getIn().setBody(oldBody + "," + newBody);



> My code is doing this:

> oldExchange.getOut().setBody(oldBody + "," + newBody);



> I am used to the Processor interface that expects the body to be set in  
> the

> "out exchange". It is strange the fact that the Aggregation Strategy  
> expects

> the "in exchange" to be updated.



> Thank you.



> --

> Wilson Freitas

> Vetta Technologies

> http://www.vettatech.com







> Claus Ibsen-2 wrote:

> >

> > Hi

> >

> > See this unit test which I have created that works.

> > http://svn.apache.org/viewvc?rev=828961&view=rev

> >

> >

> > On Wed, Oct 21, 2009 at 8:15 PM, Wilson wilson.lists@gmail.com> wrote:

> >>

> >> Hi Claus,

> >>

> >> Thanks for your answer.

> >>

> >>

> >> Claus Ibsen-2 wrote:

> >>>

> >>> Hi

> >>>

> >>> Do you "loose" message every time you run the unit test?

> >>>

> >>> Have you tried with a higher batch timeout?

> >>>

> >>>

> >>> --

> >>> Claus Ibsen

> >>> Apache Camel Committer

> >>>

> >>> Open Source Integration: http://fusesource.com

> >>> Blog: http://davsclaus.blogspot.com/

> >>> Twitter: http://twitter.com/davsclaus

> >>>

> >>>

> >>

> >> Yes. The "message lost" happens every time I run the code. I think the

> >> problem is not related to batchTimeout. BTW increasing the batchTimeout

> >> to

> >> 100 secs has no effect. As you can see in the logs, the messages are

> >> produced very quickly and all of then are passing through the  
> Aggregator.

> >>

> >> Looks like the exchange produced by the Aggregator is the one created

> >> when

> >> the message n-1 is aggregated. I am not sure, but I think the exchange

> >> returned by the last aggregator cycle is being ignored.

> >>

> >> This is what I think is happening:

> >>

> >> For n messages:

> >> -->Exchange(1)--Aggregator-->AggregatedExchange(1)-->

> >>  
> -->Exchange(2),AggregatedExchange(1)-->Aggregator-->AggregatedExchange(2)-->

> >>  
> -->Exchange(3),AggregatedExchange(2)-->Aggregator-->AggregatedExchange(3)-->

> >> ...

> >>  
> -->Exchange(n-1),AggregatedExchange(n-2)-->Aggregator-->AggregatedExchange(n-1)-->(this

> >> one is produced by the aggregator)

> >>  
> -->Exchange(n),AggregatedExchange(n-1)-->Aggregator-->AggregatedExchange(n)-->(this

> >> one is being lost or ignored somehow)

> >>

> >> Thank you,

> >>

> >> --

> >> Wilson Freitas

> >> Vetta Technologies

> >> http://www.vettatech.com

> >> --

> >> View this message in context:

> >> http://www.nabble.com/Aggregator-message-lost-tp25976380p25997564.html

> >> Sent from the Camel - Users mailing list archive at Nabble.com.

> >>

> >>

> >

> >

> >

> > --

> > Claus Ibsen

> > Apache Camel Committer

> >

> > Author of Camel in Action: http://www.manning.com/ibsen/

> > Open Source Integration: http://fusesource.com

> > Blog: http://davsclaus.blogspot.com/

> > Twitter: http://twitter.com/davsclaus

> >

> >



> --

> View this message in context:  
> http://old.nabble.com/Aggregator-message-lost-tp25976380p26374868.html

> Sent from the Camel - Users mailing list archive at Nabble.com.