Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.21.0, 2.21.1
-
None
-
Unknown
Description
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:
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(); } ...
this consideration is made by analysing similar behavior and lifecycle of header AGGREGATION_COMPLETE_ALL_GROUPS:
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(); } ...