if (routeId != null && exchange.getFromRouteId() == null) {
exchange.setFromRouteId(routeId);
}
if (exchange.getUnitOfWork() == null) {
UnitOfWork unitOfWork;
// If there is no existing UoW, then we should start one and
// terminate it once processing is completed for the exchange.
if (exchange.getContext().isUseMDCLogging()) {
unitOfWork = new MDCUnitOfWork(exchange);
} else {
unitOfWork = new DefaultUnitOfWork(exchange);
}
final UnitOfWork uow = unitOfWork;
exchange.setUnitOfWork(uow);
try {
uow.start();
} catch (Exception e) {
callback.done(true);
exchange.setException(e);
return true;
}