On Wed, Jun 10, 2009 at 11:10 AM, ErwinK<[email protected]> 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://[email protected]&[email protected]");
>
> Now, when a message is filtered out, I still get it as an individual message
> at the smtp endpoint, is this suposed to happen?

If you want to split a single message to X messages, filter out some
messages and only send the non filtered to the SMTP then just do

from("timer://timer?period=3600000")
  .to("ldap:ldapConnection?base=&scope=subtree")
  .splitter(body(List.class), new MyAggregationStrategy())
     .filter(some expression)
     .to("smtp://[email protected]&[email protected]")
  .end();

And if you do not need to do something thereafter, you do not need
your custom aggregation strategy, so you can do

from("timer://timer?period=3600000")
  .to("ldap:ldapConnection?base=&scope=subtree")
  .splitter(body(List.class))
     .filter(some expression)
     .to("smtp://[email protected]&[email protected]")
  .end();

And the last end is also optional in this case.

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

Reply via email to