Hi Team,
i have to following Use Case:
We use for all our routes a customized ErrorHandler: MyErrorHandlerBuilder
extends DeadLetterChannelBuilder
In case of .transacted routes I would like that the TransactionErrorManager
kicks in and overrules our custom ErrorHandler and rollback exceptions.
*My two questions:*
a) Is this per design not possible to use a customErrorhandler *and *in
case of transacted routes to overruled by TransactionErrorHandler
b) Can i tell the camel engine something like (if exchange.istransacted()
then exit errorHandler and throw exceptions)
Thanks for your support
Michael
*Example Code (simplified)*
(we use spring-boot)
@Override
public void configure() throws Exception {
errorHandler("MyErrorHandlerBuilder");
from(JMS + "?transacted=true")
* .transacted("PROPAGATION_REQUIRED")*
.split().method(SplitterBean.class, "splitByLine").shareUnitOfWork()
.to("sql:INSERT INTO TABLE1( COLUMN1, COLUMN2 ) VALUES
(:#${body[0]},:#${body[1]})?dataSource=#testDB")
.to(MOCK_JMS_RESULT);
}
*Logs:*
o.a.c.s.s.SpringTransactionPolicy - The ErrorHandlerBuilder configured is
not a TransactionErrorHandlerBuilder: DeadLetterChannelBuilder
.....
o.a.c.s.s.TransactionErrorHandler - Transaction commit
......
SOME Exception
......
o.a.c.p.Pipeline - Message exchange has failed: so breaking out of pipeline
for exchange: Exchange[...] *Handled by the error handler*.
o.a.c.s.s.TransactionErrorHandler - *Transaction commit* (0x492c8137)
redelivered(false) for (MessageId: ... on ExchangeId: ...))