camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Filtered message after splitter shows up after aggregation
Date Wed, 10 Jun 2009 09:28:57 GMT
Hi

The ticket to track this issue is at:
https://issues.apache.org/activemq/browse/CAMEL-1691

On Wed, Jun 10, 2009 at 11:26 AM, Claus Ibsen<claus.ibsen@gmail.com> wrote:
> On Wed, Jun 10, 2009 at 11:10 AM, ErwinK<erwin.kroon@gmail.com> wrote:
>>
>> Hi,
>>
>> When I have the following route:
>>
>> from("timer://timer?period=3600000")
>> .to("ldap:ldapConnection?base=&scope=subtree")
>> .splitter(body(List.class), new MyAggregationStrategy())
>> .filter(some expression)
>> .end()
>> .to("smtp://mail.host.com?from=mail@host.com&to=mail@host.com");
>>
>> Now, when a message is filtered out, I still get it as an individual message
>> at the smtp endpoint, is this suposed to happen?
> Hi
>
> Ah I can see the issue now. When you use a filter in the split sub
> route, it just filters from processing any further in this subroute.
> But it will aggregate all messages using your strategy. Even if it was filtered.
>
> The filter in Camel just blocks the message from being routed any
> further. It does not mark it as filtered.
> What is needed to let this work is to add this logic inside Camel to
> mark the message as being filtered so the aggregator can skip this
> message.
>
> As a workaround you can implement the fiter logic in your aggregation strategy.
>
> You can also invoke expression or predicates from that Java code, if you like.
>
> In the route builder you can define a predicate:
> Predicate goodWord = body().contains("World");
>
> And then pass it in as argument to the constructor of your aggregation strategy
> Then you can evaluate the predicate in the javacode.
>
>
> I will create a ticket about the mark a message as filtered so Camel
> can skip it in aggregation strategies.
>
>
>
>
>
>>
>> Regards,
>> Erwin
>> --
>> View this message in context: http://www.nabble.com/Filtered-message-after-splitter-shows-up-after-aggregation-tp23957958p23957958.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message