What's New in Spring Integration 2.2 (Part 2 - Transaction Synchronization)
Introduction
This is the second part in a series of blog posts highlighting some of the new features available in Spring Integration 2.2 following the recent release of Release Candidate 1. The first part talks about the MongoDB adapters.Spring Integration 2.2 introduces extended support for synchronizing non-transactional resources with transactions.
Background
Spring has provided first class support for synchronizing resources with transactions for many years. In many cases, this facility is used to synchronize transactions managed by multiple transaction managers, in order to implement the 'Best Efforts 1PC' pattern described in Dave Syer's excellent JavaWorld article.It is often used, for example, to synchronize a JMS commit with a JDBC commit.
Spring Integration has long supported this feature, by defining a <transactional/>
element on a poller. This release takes this feature one step further, by allowing synchronization of non-transactional resources with a transaction.
For example, consider a <file:inbound-channel-adapter/>
and an Integration application that reads a file when it appears in a directory, and updates a database. This…