Hi camel experts,
we have a problem with redeliveries/exception handling when an exception
occurs within the JPA commit/flush at transaction end.
In a camel route we are using JMS on the receiving side and JPA on the sink
side. Transaction management is performed using JTA.
<route id="myroute">
<from uri="jms:input.queue"/>
<transacted />
<to uri="bean:mybean?method=persist"/>
</route>
Within the bean JPA is used to persist some objects.
Now, in case we persist something which will lead to a Unique Constraint
Violation this will happen only at transaction commit time (maybe in the
JPA flush performed as part of that commit). This will lead to a rollback
both on JPA as well as on JMS side (which is okay and required).
Now, JMS will try to redeliver the message, which will lead to a loop.
How is this in general handled in the camel world? Is there a way - or is
the only way to configure our JMS provider to move failing messages finally
to a dead letter queue?
Thank you.
Kind regards,
Jörn