You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Yves De Moor (JIRA)" <ji...@apache.org> on 2014/02/04 14:10:10 UTC

[jira] [Created] (CAMEL-7167) AbstractListAggregationStrategy : at the end of the split, the body is not replaced by the agregated list

Yves De Moor created CAMEL-7167:
-----------------------------------

             Summary: AbstractListAggregationStrategy : at the end of the split, the body is not replaced by the agregated list
                 Key: CAMEL-7167
                 URL: https://issues.apache.org/jira/browse/CAMEL-7167
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.12.1
            Reporter: Yves De Moor
            Priority: Minor


Using a class that extends AbstractListAggregationStrategy to rebuild a List after the completion of the split cause the body not to be replaced by the agregated list at the end of the split.

In other words (AbstractListAggregationStrategy.onCompletion(Exchange exchange) is never called.


Here is what I do :

from(HANDLE_A_LIST)//
            .split(body(), new ListAggregationStrategy())// body is an arrayList of String
            .to("log:foo")//
            .end()// end split
            // the body is a string instead of a List
            .end()// end route

   
class ListAggregationStrategy extends AbstractListAggregationStrategy<String>
    {

        @Override
        public String getValue(Exchange exchange)
        {
            return exchange.getIn().getBody();
        }
    }

As workaround, I use .setBody(property(Exchange.GROUPED_EXCHANGE)) after the end of the split.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)