You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by srikarn <sr...@gmail.com> on 2014/11/10 16:10:51 UTC

Camel Aggregator: how to stop route on first failed Message

Hi,

I have setup my aggregator as follows. 

LevelDBAggregationRepository repository = new
LevelDBAggregationRepository(REPO_NAME, repoLocation+"/"+REPO_NAME+".dat");
        repository.setUseRecovery(true);
        repository.setMaximumRedeliveries(3);
        repository.setRecoveryInterval(3000);
        repository.setDeadLetterUri("mock:dead");

        from(UPDATE_ENDPOINT)
                .aggregate(header("fileId"), new
ESSessionAggregationStrategy()) // aggregates into an arraylist
                .aggregationRepository(repository)
                .completionPredicate(constant(false))
                .to("es://bulk") // my elasticsearch component

I am flushing all the aggregates by sending a message with the header
Exchange.AGGREGATION_COMPLETE_ALL_GROUPS=true.

If elasticsearch component is not available, I would like to stop the route
with all messages in the repository. Is there any way to do this?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Aggregator-how-to-stop-route-on-first-failed-Message-tp5758837.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Aggregator: how to stop route on first failed Message

Posted by Claus Ibsen <cl...@gmail.com>.
See the control bus eip

On Mon, Nov 10, 2014 at 4:10 PM, srikarn <sr...@gmail.com> wrote:
> Hi,
>
> I have setup my aggregator as follows.
>
> LevelDBAggregationRepository repository = new
> LevelDBAggregationRepository(REPO_NAME, repoLocation+"/"+REPO_NAME+".dat");
>         repository.setUseRecovery(true);
>         repository.setMaximumRedeliveries(3);
>         repository.setRecoveryInterval(3000);
>         repository.setDeadLetterUri("mock:dead");
>
>         from(UPDATE_ENDPOINT)
>                 .aggregate(header("fileId"), new
> ESSessionAggregationStrategy()) // aggregates into an arraylist
>                 .aggregationRepository(repository)
>                 .completionPredicate(constant(false))
>                 .to("es://bulk") // my elasticsearch component
>
> I am flushing all the aggregates by sending a message with the header
> Exchange.AGGREGATION_COMPLETE_ALL_GROUPS=true.
>
> If elasticsearch component is not available, I would like to stop the route
> with all messages in the repository. Is there any way to do this?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Aggregator-how-to-stop-route-on-first-failed-Message-tp5758837.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/