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.

Reply via email to