0

In our angular application we have to call 3 different API's (POST,POST,PUT) respectively and all are from different microservices. When all three api's execute successfully then only the transaction is successfull and if anyone of them fails we have to rollback changes of that api on the backend (backend written in Springboot). So this problem basically falls under Distributed transactions problem. To solve this our tech architects are suggesting to solve it using Apache Kafka.

The suggestion suggested is to call the API's from UI and send the response of the api's one by one to kafka broker (topic) and then the backend(consumer) will recieve and check the response, if all three API's are success then backend will send the ackowledgement as ok to UI otherwise backend will rollback the changes for all the failed API's.

I am new to kafka and have understood the overall concept of it but cannot find any resource how i can connect from Angular(producer) to kafka broker and send and recieve the response or message to it. Any help will mean a lot to me!

blume0F
  • 65
  • 2
  • 10

0 Answers0