May 19th, 2011, 05:05 PM
JMS Inbound channel adaptor and transactions
0 down vote favorite
I am using SI configured with a jms:message-driven-channel-adapter. My use case is to receive a message from the queue, save it via JDBC to a database, commit the message from the queue, and then let this message continue to flow through the various channels depending on its type. If the message subsequently errors this is ok as I have the original stored in the database so it can be replayed.
My issue is with trying to commit the transaction from the queue immediately after the database persist. This is effectively mid flow and I have only been able to get the spring transaction management to try and commit right at the end. This is not suitable as if an error is thrown after the database persist it still leaves the message on the JMS queue, as this is where the outer transaction originated.
So, is there an easy way to pull the message from a JMS queue, save to database, then commit it off the queue and start a new transaction for the remaining flow?
May 20th, 2011, 11:27 AM
The whole point in using JMS transactionally is to let it handle message persistence and delivery. I'm not sure why you'd want to take over this responsibility inside your application.
Tags for this Thread