I am currently having difficulties with a JMS transaction in Spring integration. The Integration Flow that I am creating is the following:
JMS queue A -> publish/subscribe channel (sync) -> JMS queue B and JMS queue C
I want guaranteed delivery of the message on JMS queue B and JMS queue C. However to make it slightly more difficult I want to store the messages that result in an error on a seperate JMQ queue and acknowledge the message on queue A.
However if I test this and throw an error before the message has been set on queue C (let's assume queue B is done first and queue C second) the transaction will acknowledge queue A and commit both the message on queue B and on the error queue.
How should I tell spring integration to not commit the message on queue B when an error occurs and only acknowledge A and commit the error queue?
Starting a new transaction for B and C will not work because then the acknowledge on A could fail after B and C are committed.