@Override
protected void processNext(Exchange exchange) throws Exception {
if (exchange.getUnitOfWork() == null) {
// If there is no existing UoW, then we should start one and
// terminate it once processing is completed for the exchange.
final DefaultUnitOfWork uow = new DefaultUnitOfWork(exchange);
exchange.setUnitOfWork(uow);
try {
uow.start();
} catch (Exception e) {
throw wrapRuntimeCamelException(e);
}
// process the exchange
try {
processor.process(exchange);
} catch (Exception e) {
exchange.setException(e);
}
// unit of work is done
exchange.getUnitOfWork().done(exchange);
try {
uow.stop();
} catch (Exception e) {
throw wrapRuntimeCamelException(e);
}
exchange.setUnitOfWork(null);
} else {