dimanche 22 février 2015

Distributed Transaction between multiple Apps in Spring

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.


enter image description here


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.


enter image description here


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?


Aucun commentaire:

Enregistrer un commentaire