I have the following pattern

I have two kinds of databases. One is a int
Add a QueueChannel somewhere upstream (i.e. before the pub sub channel for tx2) and use a poller to start the transaction.
Alternatively, insert a transactional gateway...
public interface TX {
@Transactional
Message> exchange(Message> m);
}
You'll need to enable transactions in the second case.