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

Roman Kalukiewicz commented on CAMEL-2287:
------------------------------------------

There is also a test that could be discussed called 
{{SplitShouldSkipFilteredExchanges}}.

It has flow like:

{code}
                from("direct:split")
                    .split(body(List.class), new MyAggregationStrategy())
                        .filter(goodWord)
                            .to("mock:filtered");
{code}

But it should be equivalent to

{code}
                from("direct:split")
                    .split(body(List.class), new MyAggregationStrategy())
                        .filter(goodWord)
                            .to("mock:filtered")
                        .end() ;
{code}

but then {{filter()}} reads like *if* statement that is simply not matched. 
Does it mean we shouldn't aggregate it back? And definitely following code 
should be aggregated back even if it contains unmatched filter:

{code}
                from("direct:split")
                    .split(body(List.class), new MyAggregationStrategy())
                        .to("direct:otherprocessing")
                        .filter(goodWord)
                            .to("mock:filtered")
                        .end();
{code}

> Using filter before split causes filtered messages to not be aggregated as 
> they where marked as filtered
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2287
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2287
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0.0, 2.1.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.2.0
>
>
> Splitter supports filtering exchanges when a filter is used inside it.
> However it should clear the filtered flag for exchanges arriving in, before 
> the splitting so Camel has no memory in case filter has been used before the 
> splitter
> {code}
>                 Predicate goodWord = body().contains("World");
>                 from("direct:start")
>                     .to("mock:before")
>                     .filter(goodWord)
>                         .to("mock:good")
>                     .end()
>                     .split(body().tokenize(" "), new MyAggregationStrategy())
>                         .to("mock:split")
>                     .end()
>                     .to("mock:result");
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to