My scenario.
consuming a message off a JMS queue and an exception happens, the message is
routed to my DeadLetterChannel where it executes my custom failureProcessor
which fails and throws an exception
im finding that the exception just gets swallowed and the message gets
consumed of the queue.
Method
RedeliveryErrorHandler.deliverToFailureProcessor
try {
// store the last to endpoint as the failure endpoint
exchange.setProperty(Exchange.FAILURE_ENDPOINT,
exchange.getProperty(Exchange.TO_ENDPOINT));
processor.process(exchange);
} catch (Exception e) {
exchange.setException(e); <--- sets the new exception
}
then just carries on and ignores the exception and resets
Method
RedeliveryErrorHandler.prepareExchangeAfterFailure
ExchangeHelper.setFailureHandled(exchange);
// honor if already set a handling
boolean alreadySet = exchange.getProperty(Exchange.ERRORHANDLER_HANDLED) !=
null;
if (alreadySet) {
boolean handled = exchange.getProperty(Exchange.ERRORHANDLER_HANDLED,
Boolean.class);
if (log.isDebugEnabled()) {
log.debug("This exchange has already been marked for handling:
" +
handled);
}
if (handled) {
exchange.setException(null);
} else {
// exception not handled, put exception back in the exchange
exchange.setException(exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
Exception.class));
// and put failure endpoint back as well
exchange.setProperty(Exchange.FAILURE_ENDPOINT,
exchange.getProperty(Exchange.TO_ENDPOINT));
}
return;
What i want it to do is try and use the failureProcessor if that fails throw
a Rutime exception and let camel reprocess the mesage.
--
View this message in context:
http://camel.465427.n5.nabble.com/Exception-in-the-DeadLetterChannel-causes-message-to-be-consumed-tp1835181p1835181.html
Sent from the Camel - Users mailing list archive at Nabble.com.