You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/12/14 13:29:52 UTC

[jira] Created: (CAMEL-2287) Using filter before split causes filtered messages to not be aggregated as they where marked as filtered

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.1.0, 2.0.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.


[jira] Commented: (CAMEL-2287) Using filter before split causes filtered messages to not be aggregated as they where marked as filtered

Posted by "Roman Kalukiewicz (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (CAMEL-2287) Using filter before split causes filtered messages to not be aggregated as they where marked as filtered

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56425#action_56425 ] 

Claus Ibsen commented on CAMEL-2287:
------------------------------------

Yeah the missing end() can be omitted when you are lazy. But I would state that it would be best practice to use end() to be consistent.


> 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.


[jira] Commented: (CAMEL-2287) Using filter before split causes filtered messages to not be aggregated as they where marked as filtered

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56419#action_56419 ] 

Claus Ibsen commented on CAMEL-2287:
------------------------------------

The workaround is to use .removeHeader(Exchange.FILTERED) in the DSL before you hit the .split() DSL

> 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.


[jira] Resolved: (CAMEL-2287) Using filter before split causes filtered messages to not be aggregated as they where marked as filtered

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2287.
--------------------------------

    Resolution: Fixed

trunk: 890339.

> 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.