jeudi 9 novembre 2017

Libraries for Transactions in Java

I have a use case where I need to implement a workflow which will deal with multiple systems and if any of the operations fail while dealing with a system, I need to rollback all the previous steps, e.g. A typical transaction for my use case would look like : (I am just making it up!)

Step1 : Add an entry to a users database.

Step2 : Send a notification to another system/service that an entry has been added to asynchronously process the new record in database. (If this step fails, after retries, I need to rollback step1 by deleting that entry from database)

Step3 : Let's say, add an entry to another database. (If this step fails, roll back, previous two steps by 1. Sending notification back to system in second step to not process the new record 2. Delete user record from the database in the first step.)

A success ACK can be sent back to the client of this API, iff all the three steps succeeds.

Can someone point me to any open source library, that can provide me the orchestration of these transactions and their rollbacks on failure?

Aucun commentaire:

Enregistrer un commentaire