JMS -> Processing -> MessageStore -> JMS JTA Transaction Commit Order
Having some trouble getting things to commit properly, and maybe I'm going about it wrong but it seems pretty close.
What I'm aiming for is that unless the application reads the message, processes, and then sends the new message out again successfully the transaction should fail. Seems pretty straightforward.
What I have is a message-driven-channel-adapter listening for (claim-check) messages. When it receives one, it: checks out the payload from a MySQL DB, does some processing, check the payload into a MySQL DB, and sends this claim check out via JMS.
Right now it mostly works, except that when the transaction is committed it commits the JMS first. It may be doing this to commit the read (and removal) of the initial message, but what happens is the JMS message is picked up by the other app listening to this queue before the payload is saved in MySQL (because that part of the transaction hasn't been committed).
I am using Atomikos to manage this JTA transaction.