javaspring-integrationspring-transactionsjtaatomikos

Spring Integration Transaction management using Atomikos


I am thinking to create a Spring Integration Spring Boot application to

1-Poll messages from a DB
2-Do some processing on it
3-Publish messages to EMS Queue

using Atomikos for Transaction management. My question is: If the above configuration will be transactional with all the required JTA configurations done? Also I have read somewhere, if multiple threads are created in Spring Integration,e.g,using a Splitter, then the context won't to transactional. How to overcome this?


Solution

  • If you configure the poller as transactional, the flow will run in a transaction, as long as you don't hand off to another thread (via an ExecutorChannel or QueueChannel channel, for example).

    Adding a splitter will not break the transaction boundary as each split will be processed on the same thread.