camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: onCompletion() in apache camel called more than one time
Date Mon, 11 Nov 2013 15:34:07 GMT
Please post your route.

On Mon, Nov 11, 2013 at 1:26 AM, vishalfichadiya
<fichadiyavishal@gmail.com> wrote:
> I am new to the camel. I am using bindy to transform my csv file to object.
> Now i want to do some post processing once all the route completed. so i
> used camel
>
> .onCompletion() tag for the same.
>
> But in case of that if i have multiple lines in my csv file then i want to
> call onCompletion() after both lines of record processed. So for that
> changes i made are like :
>
> onCompletion().onWhen(property("CamelSplitComplete").isEqualTo("true"))
> .process(new Processor() {
>
>                 @Override
>                 public void process(Exchange exchange) throws Exception {
>                     LOG.info("Inside Split Complete processor");
>
>                 }
>         }).to("log:global");
> and then i attached processor for post processing stuff. But in my case the
> above code executes more than one time and the Logger "Inside Split Complete
> processor" prints more than one time. So can you please advice me what to do
> so that my code executes on single time so that i can do some post
> processing stuff only once. Also i had tried options with
>
> .onCompletin().onCompleteOnly()
> in which it also got called more than one time and
>
> .onCompletin().onCompleteOnly()
> in which it didn't get called.
>
> Just for information, in my route builder i have many .from() and .to()
> endpoints and only single global onCompletion().
>
> So can you please advice me what went wrong in my code / how to tackle this
> issue ?
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/onCompletion-in-apache-camel-called-more-than-one-time-tp5743011.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Mime
View raw message