Camel onCompletion is not working as expected -
i have following route in want log after completing database insert task.
from("file:src/data?noop=true").unmarshal(jaxb) .bean(setqueryparametertomap.class) .to("sql:{{insertdata}}?datasource=mydatasource") .oncompletion().log(" inserted time " + new date()).end(); but the log msg printed many times instead of printing once. had tried along oncompleteonly also, no effect. expected behavior or missing thing here?
oncompletion isn't used determine when single task has completed. since sql component runs in same thread anyway, finished before moving on next step in route. remove .oncompletion (and .end).
Comments
Post a Comment