You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ronP12 <po...@bah.com> on 2010/02/23 19:23:11 UTC

Aggregator

Hello,
 I am polling a directory and only want to aggregate files if they meet a
certain criteria (ie: camelfileparent = dir).  This works fine, but, the
exchange doesn't process for the messages that don't meet this criteria. My
route is similar to:

from("file:/tmp").
  choice().when(header("CamelFileParent").isNotEqualTo("xyz").
  aggregate(new MyStrategy()).

  to("file:/output");

I want all my exchanges to reach the exit point, but, only the aggregated
ones do.




-- 
View this message in context: http://old.nabble.com/Aggregator-tp27707895p27707895.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I think you can use the filter EIP instead of CBR which then on the
backside of the filter should allow to continue routing.
Remember to use .end() to indicate the end of the filter route when
using Java DSL.

In fact you may be able to do the same with the CBR
 from("file:/tmp").
  choice().when(header("CamelFileParent").isNotEqualTo("xyz").
  aggregate(new MyStrategy()).
  .to("log:foo") // aggregator MUST have an output so we just log to
foo since you want to continue
.end()
// now both should go to the file output
  to("file:/output");


On Tue, Feb 23, 2010 at 7:23 PM, ronP12 <po...@bah.com> wrote:
>
> Hello,
>  I am polling a directory and only want to aggregate files if they meet a
> certain criteria (ie: camelfileparent = dir).  This works fine, but, the
> exchange doesn't process for the messages that don't meet this criteria. My
> route is similar to:
>
> from("file:/tmp").
>  choice().when(header("CamelFileParent").isNotEqualTo("xyz").
>  aggregate(new MyStrategy()).
>
>  to("file:/output");
>
> I want all my exchanges to reach the exit point, but, only the aggregated
> ones do.
>
>
>
>
> --
> View this message in context: http://old.nabble.com/Aggregator-tp27707895p27707895.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus