Well, it looks like you don't have a completion scenario specified for
your aggregator. The aggregator needs to know "when is an aggregate
completed" See the wiki here: http://camel.apache.org/aggregator2.html

Additionally, you may consider that the splitter uses an aggregator
built in to it. This aggregator can be used to do what you're trying
as well:

http://camel.apache.org/composed-message-processor.html
http://camel.apache.org/splitter.html

On Mon, Nov 25, 2013 at 5:04 AM, smehta34 <sachin.meht...@gmail.com> wrote:
> Hi,
>
> I have a simple requirement, a route which accepts a .csv file having
> HEADER, RECORD and FOOTER. I want to process that file row by row (Filtering
> HEADER and RECORD) and aggregating Records at the last.
>
> Sample Route:
> ------------
>  from( "seda:" + RouteId ).routeId(RouteId)
>     .onException(Exception.class).maximumRedeliveries(0)
>         .log( "Error processing file")
>     .end()
>     .split(expression)  //split row by row
>     .streaming()
>     .stopOnException()
>         .filter(new HeaderFooterCheck())
>                 .aggregate(correlationExpression, new
> MyStringBuilderAggregationStrategy())
>                 .to(directEndpoint)
>                 .end()
>         .end()
>    .end()
> .end();
>
> Here, at HeaderFooterCheck() I am checking whteher a record(a single row of
> csv file) is Header or Footer and returning True or False.
>
> When Header is coming, Filter is skipping Header.
> When Record is coming, Filter will put Record in Aggregator once the
> filtering is done.
> When at last Footer comes, Filter filter out the Footer and whole route is
> getting skipped and nothing is going in Aggregator.
>
> Question is why Filter is skipping full route?
>
> Any solution will be helpful.
>
> Regards,
> Sachin
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Filter-tp5743794.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Reply via email to