[ https://issues.apache.org/jira/browse/CAMEL-12589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-12589: ----------------------------------- Assignee: Claus Ibsen > Surviving Header AGGREGATION_COMPLETE_ALL_GROUPS_INCLUSIVE affects following > aggregations > ----------------------------------------------------------------------------------------- > > Key: CAMEL-12589 > URL: https://issues.apache.org/jira/browse/CAMEL-12589 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.21.0, 2.21.1 > Reporter: Gianandrea Rigoni > Assignee: Claus Ibsen > Priority: Minor > Fix For: 2.22.1, 2.23.0 > > > When AGGREGATION_COMPLETE_ALL_GROUPS_INCLUSIVE is once set true it survives > current aggregation processing and affects in unexpected way following > aggregation by triggering "forceCompletionOfAllGroups()" again > in next code snippet might be needed some additional handling when the header > is true: > {code:java} > protected void doProcess(Exchange exchange) throws Exception { > ... > // check for the special header to force completion of all groups > (inclusive of the message) > boolean completeAllGroupsInclusive = > exchange.getIn().getHeader(Exchange.AGGREGATION_COMPLETE_ALL_GROUPS_INCLUSIVE, > false, boolean.class); > if (completeAllGroupsInclusive) { > forceCompletionOfAllGroups(); > } > ... > {code} > this consideration is made by analysing similar behavior and lifecycle of > header AGGREGATION_COMPLETE_ALL_GROUPS: > {code:java} > private List<Exchange> doAggregation(String key, Exchange newExchange) throws > CamelExchangeException { > ... > ... > // check for the special exchange property to force completion of all > groups > boolean completeAllGroups = > answer.getProperty(Exchange.AGGREGATION_COMPLETE_ALL_GROUPS, false, > boolean.class); > if (completeAllGroups) { > // remove the exchange property so we do not complete again > answer.removeProperty(Exchange.AGGREGATION_COMPLETE_ALL_GROUPS); > forceCompletionOfAllGroups(); > } else if (isCompletionOnNewCorrelationGroup() && originalExchange == > null) { > // its a new group so force complete of all existing groups > forceCompletionOfAllGroups(); > } > ... > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)