Hi Everyone,
So I have been working on this issue for almost the past 15 hours
straight and can't seem to find the solution. I created a simply maven
project to display what I am seeing. I have thus far been unable to get a
JMS transaction manager (defined as a policy in my camel route) to force
redelivery from AMQ on an exception occurring. I looked through the user
forum and went through a bunch of the examples, but unfortunately, it was to
no avail. All you need to do to run the test is extract the zip (renamed to
.zzz for the post) and execute 'mvn test' and you should see the results I
am seeing... :)
Here is a quick breakdown:
from("activemq:queue:TestQueue")
.errorHandler(noErrorHandler()) //We don't want a local
re-delivery
policy
.policy(required) //Set the transactional client before the
error
producing processor
.process(errorProducingProcessor) //This processor will throw
exceptions on messages
.to("mock:foo");
when I do not throw exceptions, the route works perfectly in my test case;
however, when I have the errorProducingProcessor in my route, the
transaction manager still seems to commit the message. I have noticed
something strange in the way the exceptions are occurring, maybe it is my
lack of understanding for the route exception handling, but when I throw an
exception from my processor, it doesn't seem to be thrown down to the
transaction manager as I would expect. I debugged the transaction processor
code and the exchange.isFailed() is returning true when it reaches the
TransactionInterceptor, but it doesn't actually throw the exception as the
try..catch within the class is expecting (or so it seems to me). Any idea
as to why the exceptions wouldn't be getting thrown as one would expect?
Any help in this matter is greatly appreciated. Thanks so much!
-Eric
--
View this message in context:
http://www.nabble.com/Transaction-policy-not-correctly-rolling-back-on-exception.-tp18173845s22882p18173845.html
Sent from the Camel - Users mailing list archive at Nabble.com.