Distributed Transaction between multiple Apps in Spring

送分小仙女□ 提交于 2019-12-04 13:55:16

问题


I currently have a set of ERP style web applications build on top spring 3. The application is deployed into tomcat 7.

The system developed some time ago without a cleanly defined architecture. Each Application has 3 parts (as sub projects). API: Defining Models and Interfaces, IMPL: The Service Layer, and the WEB.

Current layout of system is as below.

Financial API+IMPL is included to Inventory module for achieving transaction management. We previously tried to separate inventory and financial into different Web apps by using REST calls but faced issue with transaction management. What we are currently doing is @Autowiring the financial Impl directly to Inventory services. For instance, When a Sale invoice is made, both financial and inventory operations must be in the same transaction.

Now, as already expected, issues with this approach pops up. Inventory system is super heavy as needs to boot a duplicate Financial Layer.

I guess introducing a Messaging Middleware like HornetQ or ActiveMq would be the best thing to do here as below.

My questions are:

  1. How can I achieve centralized transaction management between Financial and Inventory?
  2. Is there a benefit here if I use a Java EE Server like jBoss?
  3. If I move one of the application into another jboss instance running in another server, Can I still have centralized transactions?

来源:https://stackoverflow.com/questions/28604899/distributed-transaction-between-multiple-apps-in-spring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!