Establishing synchronous communication with the account microservice
We’re done with the transaction service, but the only thing missing is our account service. The transaction service allows us to specify an accountId
value and status from the payload. We need to make the following changes:
- Verify if the provided
accountId
exists and is in a valid state (new or active) - If
accountId
is valid, then create a transaction with theCreated
status - If
accountId
is invalid, then create a transaction with theFailed
status
The purpose here is not to fully implement the transaction domain. Of course, the current domain has more requirements than the previous one, but our focus is to practice and establish synchronous communication between the transaction and account services.
We have already talked about the pros and cons of synchronous communication between microservices. While asynchronous communication offers many benefits for microservices, there are situations...