Stuck on how to handle my exceptions
Hi,
I've been stuck for a while on a simple case about how to handle exceptions correctly in my flows.
Could somebody help me with that please ?
Here is what I want to do :
- Read a message from a JMS Queue in transaction (so no asynchronous flow possible)
- Call a few transformers and service-activators (still within the JMS transaction)
- Post the resulting message in another JMS Queue.
- In case an exception occurs anywhere in this process, I want to catch the exception, log it and store the incoming message (in another JMS Queue for example). Then commit the transaction and process the next message.
I thought of setting a ErrorHandler on the <message-driven-channel-adapter>, but even though the exception is catched and the ErrorHandler well executed, the exception is also thrown back, so the transaction is rollbacked ! Thus, the message never gets committed and is processed over and over...
This seems quite a simple case, but no clue how to deal exceptions in this case... Any idea that could help me out?
Thank you very much!
Pierre