Global Transaction Handling in Spring Integration

2019-08-31 18:03发布

问题:

Its a Spring Integration application.I have a requirement where I need to persist to DB and then post to Queue/Topic. This should be part of a single transaction. I am planning to use the JTATransactionManager. Application Server is Tomcat. Would someone please provide some sample configuration code required for this implementation.

回答1:

You need a third party stand-alone XA transaction manager such as Atomikos. Tomcat doesn't have one.

You might also consider alternatives to using full-blown 2pc.