protected void processExchangeWithoutTx(MessageExchange exchange) { ExchangeStatus oldStatus = exchange.getStatus(); try { processExchange(exchange); } catch (Throwable t) { logger.error("Error processing exchange {}", exchange, t); try { // If we are transacted and this is a runtime exception // try to mark transaction as rollback if (transactionManager != null && transactionManager.getStatus() == Status.STATUS_ACTIVE && exceptionShouldRollbackTx(t)) { transactionManager.setRollbackOnly(); if (!container.handleTransactions()) { transactionManager.suspend(); } } if (oldStatus == ExchangeStatus.ACTIVE) { exchange.setError(t instanceof Exception ? (Exception) t : new Exception(t)); channel.send(exchange); } } catch (Exception inner) { logger.error("Error setting exchange status to ERROR", inner); } } }
transactionManager.resume(tx); processExchange(exchange); } catch (Throwable t) { logger.error("Error processing exchange {}", exchange, t);