I would suggest reading by size from your data source and use split and
aggregate together to see the end of batch..

On Wed, Sep 12, 2018 at 4:42 PM Michael Joyner <michaelwjoy...@gmail.com>
wrote:

> Hi,
>
> Is there a way for the .aggregate to keep firing until predicate is
> satisfied?
> Like this:
> from("direct:database-save")
> .log("Fetch 500 records until no more ....")
> .aggregate(constant(true), batchAggregationStrategy())
> .completionPredicate().simple("${body.get('offset')} != -1")
> .completionTimeout(BATCH_TIME_OUT)
> .execute("direct:fetchBatchFromAPI") <====== LIKE THIS
> .log("All records are fetched ....");
>
> I bascially want to avoid looping when the aggregator has a predicate. I
> just want to ask if there is a method that I don't know about.
> Thank you,
> Michael Joyner
>

Reply via email to