Hi Claus,

By resubmitting I meant triggering some custom logic to redeliver the exchange 
at the beginning of the route.  I saw that HawtDB, when used as aggregator 
persistent store, offers redelivery if the exchange processing fails following 
a successful aggregation.  I probably got a little confused as I meant 
redelivery from the beginning, not post-aggregation.

I just checked out the TimeoutAwareAggregationStrategy.  That's exactly what we 
we need. :)


Thanks!
Mathieu


----------------------------------------
> From: [email protected]
> Date: Mon, 24 Oct 2011 19:49:10 +0200
> Subject: Re: Aggregator - how to fail & resubmit if timeout expired
> To: [email protected]
>
> On Thu, Oct 20, 2011 at 2:30 PM, Mathieu Lalonde <[email protected]> wrote:
> >
> > Hi,
> >
> > I was wondering what was the best way to resubmit exchanges that did not 
> > get aggregated within a given timeout.
> >
>
> What do you mean by resubmitting? The timeout occurs due the
> aggregation group did not complete within a given time period.
> So in your example if after X period of inactivity, and then any of
> the other regular completion conditions did not occur (eg
> completionSize)
> then the timeout triggers instead. So you can't really resubmit anything.
>
> And yes checking that header is a good solution.
>
> Alternatively you can implement TimeoutAwareAggregationStrategy as
> your aggregation strategy
> and do custom code in the timeout method, such as setting some exception etc.
>
>
>
> >
> > from("direct:aggregate")
> >   .aggregate(MyStrategy).completionSize(2).completionTimeout(..)
> >   .to("mock:result");
> >
> > It seems like the completionTimeout is to decide when the exchanges should 
> > be considered aggregated.  I saw an option for discarding exchanges 
> > aggregated only because of completionTimeout but this is not what I want.  
> > I want them to be considered failed Exchanges so that they can be 
> > resubmitted (via onException()).
> >
> > Our fallback approach would be to throw an exception if 
> > Exchange.CamelAggregatedCompletedBy == timeout.  I was just wondering if 
> > there was a more elegant idiom.
> >
> > Thanks!
> > Mathieu
> >
> >
> > P.S. I checked out
> > http://camel.apache.org/aggregator2.html
> > http://camel.apache.org/aggregate-example.html
> >
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: [email protected]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
                                          

Reply via email to