I have the following pattern
I have two kinds of databases. One is a internal database where it saves data from 5 json datas from http inbound gateways. The Other is a external database where it saves final refiend data from 5 jsons saved tables.
The Process is like the followings.
One Transaction
① Each message is saved to each table and return status to the client where it sends data.
Second Transaction
② If 5 kinds of datas are completed to receive, it activate one service activator where queries 5 tables and make 3 kinds of refined data that will save in external database.
③ The next connected channel type is a publish-subscribe channel.
④ There are 3 kinds of subscribe channel to deliver each jdbc-outbound-gateway for saving data to external database. (There is a rowmapper process to handle saving multiple rows)
How can I set the transaction for being guaranteed? Please let me know elaborately.