Re: How to stop aggregate on exception
Aggregated exchanges are fundamentally disconnected from the point of aggregation. I don't know of a way to circumvent this using standard features. You might consider creating a processor that performs your aggregation logic. On Wed, Jan 31, 2024 at 6:07 AM Aditya Kavathekar < kavathekar.adi...@gmail.com> wrote: > Hi Jeremy, > Thanks for your response. > > I tried the SynchronusExecutorService it is still not stopping incase of > exception. > The aggregation is getting continued. > Please let me know if I can try something else. > > Thanks, > Aditya > > On Wed, 31 Jan 2024, 12:58 am Jeremy Ross, > wrote: > > > Using a standalone aggregator as you've configured will result in the > > aggregations completing in a separate thread with the side effect that > the > > aggregated exchange is completely disconnected from the split. > > > > And you're correct that if you use the splitter's aggregation slot that > you > > don't get to provide completion parameters. That's because the > aggregation > > is complete when there are no more items to split. > > > > Using your standalone aggregator, you can try populating the aggregator's > > executorService option with a SynchronousExecutorService. This will > result > > in aggregations completing on the same thread as the splitter. But I'm > not > > sure if that means that exceptions in the aggregator bubble up to the > > splitter. You'll have to test this. > > > > > > On Tue, Jan 30, 2024 at 11:24 AM Aditya Kavathekar < > > kavathekar.adi...@gmail.com> wrote: > > > > > Hello community, > > > I am using camel 3.20.5 in XML DSL. > > > I am trying to achieve batch processing and below is my source code. > > > > > > > > > > > completionSize= 500 completionTimeout= 1000> > > > //Some code > > > //Exception occurs here > > > > > > > > > > > > OnException block here > > > > > > Now here I want to stop the aggregation incase any exception occurs > > inside > > > it but the aggregator just executes the code from onException block and > > > continues its execution. Please suggest a way to stop aggregation > incase > > of > > > exception. > > > > > > Alternatively if I add the aggregation strategy to the split then It > > stops > > > on exception but I am not able to provide completionSize or > > > completionTimeout options in split. Please suggest if I am missing > > > something here. > > > > > > Thanks, > > > Aditya > > > > > >
Re: How to stop aggregate on exception
Hi Jeremy, Thanks for your response. I tried the SynchronusExecutorService it is still not stopping incase of exception. The aggregation is getting continued. Please let me know if I can try something else. Thanks, Aditya On Wed, 31 Jan 2024, 12:58 am Jeremy Ross, wrote: > Using a standalone aggregator as you've configured will result in the > aggregations completing in a separate thread with the side effect that the > aggregated exchange is completely disconnected from the split. > > And you're correct that if you use the splitter's aggregation slot that you > don't get to provide completion parameters. That's because the aggregation > is complete when there are no more items to split. > > Using your standalone aggregator, you can try populating the aggregator's > executorService option with a SynchronousExecutorService. This will result > in aggregations completing on the same thread as the splitter. But I'm not > sure if that means that exceptions in the aggregator bubble up to the > splitter. You'll have to test this. > > > On Tue, Jan 30, 2024 at 11:24 AM Aditya Kavathekar < > kavathekar.adi...@gmail.com> wrote: > > > Hello community, > > I am using camel 3.20.5 in XML DSL. > > I am trying to achieve batch processing and below is my source code. > > > > > > > completionSize= 500 completionTimeout= 1000> > > //Some code > > //Exception occurs here > > > > > > > > OnException block here > > > > Now here I want to stop the aggregation incase any exception occurs > inside > > it but the aggregator just executes the code from onException block and > > continues its execution. Please suggest a way to stop aggregation incase > of > > exception. > > > > Alternatively if I add the aggregation strategy to the split then It > stops > > on exception but I am not able to provide completionSize or > > completionTimeout options in split. Please suggest if I am missing > > something here. > > > > Thanks, > > Aditya > > >
Re: How to stop aggregate on exception
Using a standalone aggregator as you've configured will result in the aggregations completing in a separate thread with the side effect that the aggregated exchange is completely disconnected from the split. And you're correct that if you use the splitter's aggregation slot that you don't get to provide completion parameters. That's because the aggregation is complete when there are no more items to split. Using your standalone aggregator, you can try populating the aggregator's executorService option with a SynchronousExecutorService. This will result in aggregations completing on the same thread as the splitter. But I'm not sure if that means that exceptions in the aggregator bubble up to the splitter. You'll have to test this. On Tue, Jan 30, 2024 at 11:24 AM Aditya Kavathekar < kavathekar.adi...@gmail.com> wrote: > Hello community, > I am using camel 3.20.5 in XML DSL. > I am trying to achieve batch processing and below is my source code. > > > completionSize= 500 completionTimeout= 1000> > //Some code > //Exception occurs here > > > > OnException block here > > Now here I want to stop the aggregation incase any exception occurs inside > it but the aggregator just executes the code from onException block and > continues its execution. Please suggest a way to stop aggregation incase of > exception. > > Alternatively if I add the aggregation strategy to the split then It stops > on exception but I am not able to provide completionSize or > completionTimeout options in split. Please suggest if I am missing > something here. > > Thanks, > Aditya >
How to stop aggregate on exception
Hello community, I am using camel 3.20.5 in XML DSL. I am trying to achieve batch processing and below is my source code. //Some code //Exception occurs here OnException block here Now here I want to stop the aggregation incase any exception occurs inside it but the aggregator just executes the code from onException block and continues its execution. Please suggest a way to stop aggregation incase of exception. Alternatively if I add the aggregation strategy to the split then It stops on exception but I am not able to provide completionSize or completionTimeout options in split. Please suggest if I am missing something here. Thanks, Aditya