Al Hobbs wrote:You could commit them both after they are both successful
Agree .But here under the hood updateTeacherServiceAPI(request); is call to microservice 1 & updateStudentServiceAPI(request);is call to microservice 2 . Here how to treat this transaction as 1 as microservice 1
shall have code something like
getConnction of Microservice DB1 commit the txn and reply which is isolated transaction and if updateStudentServiceAPI(request); fails because of some reason I have to reinitiate a txn to microservice 1 saying undo the record update done in updateTeacherServiceAPI(). Which is quite difficult if by the time microservice 1 goes down then ? System shall remain in unConsistent state. I wish to do it with some standard framework if there is already in Springboot distributed Transaction management they way it is in EJB i.e. TransactionalAttributes.