Hi,
As explained in the book, i would like to test my transaction configuration
by using interceptors. But i've two problems:
-first, when i define an intercept on the context level, Camel doesn't use
my intercept (this is very unfortunate because i would like to disable the
intercept when i release the application). As work around, i could use
Spring aop to add an advice on the configure method (RouteBuilder). In this
way, i could automaticly disable the advice in my maven release.
-secondly, if i've in my routebuilder:
interceptSendToEndpoint("jpa://be.smals.eflux.domain.MessageBody")
.when(simple("${in.header.txtest} contains 'ThrowExceptionAfterFrom'))
.throwException(new RuntimeException("RuntimeException for transaction
testing"));
from(getRouteFrom())
.onException(Exception.class).useOriginalMessage()
.handled(true)
.to(getRouteDL())
.end()
.transacted("required")
.beanRef(getMapper(), "mapToMessageDto")
...
.to("jpa://be.smals.eflux.domain.MessageBody")
.to(getDirectEndpoint());
The exception is well thrown by my interceptor but not catched by the
"onexception" and my transaction is rollbacked. Whereas if an exception is
thrown in the route the onexception block is processed and the transaction
is well commited.
Thank you in advance for your help,
--
View this message in context:
http://camel.465427.n5.nabble.com/testing-transaction-tp3339993p3339993.html
Sent from the Camel - Users mailing list archive at Nabble.com.