camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pontus Ullgren <ullg...@gmail.com>
Subject Re: Filter and Aggregation Completion
Date Fri, 06 Jul 2012 11:17:24 GMT
Just figured out that in newer version of Camel you set the predicate
by calling
 from("file:/camel/inbox?noop=true")
  .aggregate().setCompletionPredicate(new Predicate() {...})

Seems like the aggregator page need some TLC .

// Pontus


On Fri, Jul 6, 2012 at 1:04 PM, Pontus Ullgren <ullgren@gmail.com> wrote:
> Just a quick guess.
>
> Since you are filtering out messages from the batch the aggregator
> will not reach a decision that the batch is completed.
> The completeion from batch will wait for ALL message to arrive.
> See section "Using Batch Consumer" on this page
> http://camel.apache.org/aggregator.html
>
> You should probably use some other means to verify that the batch is
> complete such as a custom PredicateAggregationCollection.
>
>
> // Pontus
>
>
> On Fri, Jul 6, 2012 at 12:06 PM, somnath <somnath.b4@gmail.com> wrote:
>> Hi,
>>
>> My requirement is
>> 1) Read a file location and extract only those files that have "End
>> Date=Today's Date" as one of the headers.
>> 2) Combine all of these files and generate a single file out of it.
>>
>> When I tried with
>>         from("file:/camel/inbox?noop=true")
>>                 .filter().method("my-filter", "readyToProcess") // Has the
>> logic described in requirement (1)
>>                 .aggregate(simple(ANY_LITERAL),new
>> MyAggregator()).completionFromBatchConsumer()
>>                 .beanRef("my-processor", "process")
>>                 .to("file:/camel/outbox?flatten=true");
>>
>> The program never enters the my-processor bean class and hence the files are
>> not generated at all.
>>
>> When removed the filter logic to the aggregate class it worked cleanly
>>         from("file:/camel/inbox?noop=true")
>>                 .aggregate(simple(ANY_LITERAL),new
>> MyAggregator()).completionFromBatchConsumer()
>>                 .beanRef("my-processor", "process")
>>                 .to("file:/camel/outbox?flatten=true");
>>
>> Is this an expected behaviour?
>>
>> -Somnath
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Filter-and-Aggregation-Completion-tp5715604.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message