I'have 2 spring boot microservice app that I send kafka request from one to another.I have questions about how to rollback if my data sending method gets a logical error with Kafka when I am processing between 2 microservices.
The logic of my application is as follows;
Request comes
Business logics are made
Records that need to be sent to Kafka are sent.
I check whether there is a timeout for the time I specified between the time the request started and the current time.
If the timeout has occurred or the logic has thrown an error, the business logic is rollbacked.
But the problem is about how to rollback my Kafka request. How is the best practice here, how do you handle this scenario in your applications. Btw, Changing order 3 and 5 may cause some problems in my point of view.