Hi,

Is it possible to in some way to use the TransactionErrorHandler and at the
same time catch and handle exceptions?

I have read the documentation under
http://camel.apache.org/error-handling-in-camel.html that for transactional
exchanges the Error Handler does not kick, so the following code in my Route
configure will not work:


errorHandler(bean(TransactionErrorHandlerBuilder.class,
"transactionErrorHandler"));

onException(SAXParseException.class).
handled(true).
policy(notsupported).
maximumRedeliveries(1).
transform().constant("Sorry, parse exception...").
to("jms:queue:validationFailed.SAXParseException");


from("jms:queue:input-queue?transacted=true").
unmarshal(jaxbDataFormat).
to("jms:queue:output-queue").


What I'm trying to accomplish is if a parsing exception occurs, I would like
my incoming message to be rolled back and put on the jms deadletter queue
(configured for the queue on the JMS provider, when the JMSXDeliveryCount
has reached it's threshold). But I would also be able to send an information
jms-message to the same jms-provider with information about why the message
has been backed out (of course outside the "incoming transaction").

Maybe a strange solution, but is it possible to handle in Camel? :)
/Henric

Reply via email to