You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Richard Vigniel (JIRA)" <ji...@apache.org> on 2016/07/01 08:07:11 UTC

[jira] [Comment Edited] (CAMEL-10084) AggregateProcessor/JdbcAggregationRepository : table COMPLETED not cleaned when AggregationStrategy.aggregate does not return oldExchange

    [ https://issues.apache.org/jira/browse/CAMEL-10084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15358616#comment-15358616 ] 

Richard Vigniel edited comment on CAMEL-10084 at 7/1/16 8:06 AM:
-----------------------------------------------------------------

we can even optimise the repository, testing    
         if(isUseRecovery()) {
...
}

before inserting and removing the aggregated exchange, in preConfirm() and confirm() methods.


was (Author: rvigniel):
we can even optimise the repository, testing    
         if(isUseRecovery()) {
...
}

before inserting and removing the aggregated exchange, in preConfitm() and confirm() methods.

> AggregateProcessor/JdbcAggregationRepository : table COMPLETED not cleaned when AggregationStrategy.aggregate does not return oldExchange 
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-10084
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10084
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-sql
>    Affects Versions: 2.16.2
>            Reporter: Richard Vigniel
>         Attachments: CAMEL-10084.patch
>
>
> Hi,
> in AggregateProcessor + JdbcAggregationRepository :
> the table _AGG_COMPLETED is not cleaned when AggregationStrategy.aggregate() does returns newExchange .
> it is ok when aggregate() returns oldExchange,
> looking at the code at these places:
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java#L662
> https://github.com/apache/camel/blob/master/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/JdbcAggregationRepository.java#L317
> https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java#L694
> it works as follow:
> 1. AggregateProcessor asks to remove oldExchange from _AGG. it gives correlationKey and oldExcange as parameter
> 2. JdbcAggregationRepository deletes exchange from _AGG with correlationKey and insert given exchange (oldExchange) in _AGG_COMPLETED 
> 3. AggregateProcessor confirms exchange is complete, and ask JdbcAggregationRepository to delete aggregated exchange from _AGG_COMPLETED
> *if aggregated exchange does not have the same id as oldExchange, point 3 does nothing and oldExchange stays in _AGG_COMPLETED*
> the problem seems to be in point 2, the aggregatedExchange should be given instead of oldExchange.
> the aggregation works fine, but the _AGG_COMPLETED fills up and recovery will definitely not work in this scenario.
> workaround: always return oldExchange in AggregationStrategy.aggregate()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)