Gianandrea Rigoni created CAMEL-12589:
------------------------------------------
Summary: Surviving Header
AGGREGATION_COMPLETE_ALL_GROUPS_INCLUSIVE affects following aggreagtions
Key: CAMEL-12589
URL: https://issues.apache.org/jira/browse/CAMEL-12589
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.21.1, 2.21.0
Reporter: Gianandrea Rigoni
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 snipped might be needed some additional handling when the header
is true:
{code}
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}
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)