camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Melikian <ch...@melikian.net>
Subject Idempotent consumer, removeOnFailure=true and exception handling
Date Mon, 08 Sep 2014 15:16:03 GMT
Hi,

So i'm using Camel 2.13.1 and the JDBC Idempotent Repository and I'd like to
use the removeOnFailure
=true option to be able to replay the transaction on failure.

My question is whether implementing an onException clause which handles an
exception would stop the removeOnFailure option from being carried out as
the failure is being marked as 'handled=true'. Here is my onException clause
in Spring XML:-

		<camel:onException>
			<camel:exception>java.lang.Exception</camel:exception>
			<camel:redeliveryPolicy logStackTrace="true"
				disableRedelivery="true" logExhausted="true" />
			<camel:handled>
				<constant>true</constant>
			</camel:handled>
			<camel:log
				message="Transaction has failed and is being handled by the exception
handler. Received message [${exception}], full stack trace
[${exception.stacktrace}]"
				loggingLevel="ERROR"
logName="com.lgim.sophis.unrecoverableerror"></camel:log>
		</camel:onException>

In the above case would the camel_messageprocessed table entry for the
failing exchange be removed?

Here is my route for idempotency:-

		<route id="idempotentTransactionsRoute">
			<from uri="direct:filterForIdempotency" />
			<idempotentConsumer messageIdRepositoryRef="jdbcIdempotentRepository">
				<el>${in.body.ID}</el>
				<to ref="direct:processTransaction" />
			</idempotentConsumer>
			<stop />
		</route>

Any help appreciated!





--
View this message in context: http://camel.465427.n5.nabble.com/Idempotent-consumer-removeOnFailure-true-and-exception-handling-tp5756198.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message