You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sven Bauhan <sv...@ast.dfs.de> on 2013/04/18 12:25:39 UTC

Aggregator and closeCorrelationKeyOnCompletion

Hi,

I use an aggregator to combine segmented messages (as the channel has 
limited size).
For each received segment a response message is expected with the 
appropriate response status.
As correlation key the message ID is used; and each segment has a 
segment number.

When a complete message is received, the correlation key shall be closed 
to prevent receiving different messages with the same message ID.

But what happens, if the message will not get completed, because a 
segment is incorrect? How can a correlation key be held open when the 
message is resend?

I am not clear, how to implement the aggregate() method in the 
AggragationStrategy. How to react when a wrong segment is received? Does 
the Aggregator reset the correlation key and segment counter 
automatically, if the aggregate() method throws an exception? Or is 
there another way to tell the Aggregator what to do?

Thanks,
Sven


Re: Aggregator and closeCorrelationKeyOnCompletion

Posted by Sven Bauhan <sv...@ast.dfs.de>.
Thanks, this works fine.
Then I only have to propagate the errors to the aggregator and let them 
throw an exception there.

On 04/18/13 15:28, Claus Ibsen wrote:
> The key is only being added as closed when the aggreaged exchange has
> been completed. So if the strategy throws an exception then its not
> completed yet.
>
> On Thu, Apr 18, 2013 at 12:25 PM, Sven Bauhan <sv...@ast.dfs.de> wrote:
>> Hi,
>>
>> I use an aggregator to combine segmented messages (as the channel has
>> limited size).
>> For each received segment a response message is expected with the
>> appropriate response status.
>> As correlation key the message ID is used; and each segment has a segment
>> number.
>>
>> When a complete message is received, the correlation key shall be closed to
>> prevent receiving different messages with the same message ID.
>>
>> But what happens, if the message will not get completed, because a segment
>> is incorrect? How can a correlation key be held open when the message is
>> resend?
>>
>> I am not clear, how to implement the aggregate() method in the
>> AggragationStrategy. How to react when a wrong segment is received? Does the
>> Aggregator reset the correlation key and segment counter automatically, if
>> the aggregate() method throws an exception? Or is there another way to tell
>> the Aggregator what to do?
>>
>> Thanks,
>> Sven
>>
>
>


Re: Aggregator and closeCorrelationKeyOnCompletion

Posted by Claus Ibsen <cl...@gmail.com>.
The key is only being added as closed when the aggreaged exchange has
been completed. So if the strategy throws an exception then its not
completed yet.

On Thu, Apr 18, 2013 at 12:25 PM, Sven Bauhan <sv...@ast.dfs.de> wrote:
> Hi,
>
> I use an aggregator to combine segmented messages (as the channel has
> limited size).
> For each received segment a response message is expected with the
> appropriate response status.
> As correlation key the message ID is used; and each segment has a segment
> number.
>
> When a complete message is received, the correlation key shall be closed to
> prevent receiving different messages with the same message ID.
>
> But what happens, if the message will not get completed, because a segment
> is incorrect? How can a correlation key be held open when the message is
> resend?
>
> I am not clear, how to implement the aggregate() method in the
> AggragationStrategy. How to react when a wrong segment is received? Does the
> Aggregator reset the correlation key and segment counter automatically, if
> the aggregate() method throws an exception? Or is there another way to tell
> the Aggregator what to do?
>
> Thanks,
> Sven
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen