Camel ExchangeCompletedEvent vs. RoutePolicy.onExchangeDone -


my camel route configured (pseudocode)

from(direct:in).to(jdbc:db).split().body().streaming().parallelprocessing() .process(dosomething).process(createdbquery).out(jdbc:db) 

the jdbc endpoint configured put out jdbcoutputtype.streamlist. route triggered sending select query direct:in. each line db handled in dosomething. creates special result object converted query write result db.

my main problem how detect if complete result db handled- i want know when finished.

i tried use eventnotifier , filtered on exchangecompletedevent. event seems raised every result written db. considering use of routepolicy / overriding "onexchangedone" change anything?

what exact semantics of both routes create new exchanges (e.g. split) on way? clean way detect when route finished?

i 've got answer claus in camel user group. using routepolicy better here because calls onexchangedone on original exchange. using event have filter out exchanges split. done checking presence of property 'exchange.correlation_id'.

other viable solutions use of '.oncompletion()' or synchronization works way:

from("direct:confirm") .process(new processor() {     public void process(exchange exchange) throws exception {         exchange.getunitofwork()               .addsynchronization(new filerollback()); } }) 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -