When one of your microservice (ex. Reader) directly depends on another microservice (ex. Processor). It creates a single point of failure.
In the worst case (heavy load or other difficulties) Processor microservice could be unreachable. In that case, the Reader service would stop working, at least for some of the features. Also, it would be a performance leak for Reader service.
Previously in Invoice.Microservices.ThirdPartyAPIIntegration application, when a new invoice is added, I fire a queue to notify about that action first and do the invoice processing later on. And inside Reader microservice, I did the check to verify the status and do the following operation.
There is a reason behind this ugly operation, we need to call third party services, and our service bus could be unreachable. In that case, we lose the data consistency.
We can do the service bus call and third party service call inside a transaction. On service bus failure, it would not call the third party service and vice versa for third party service.
Currently, we have OutboxController and corresponding features as dead code. I am going to keep this to make that an example of synchronize communication between microservices.
What is a Single Point of Failure?
When one of your microservice (ex. Reader) directly depends on another microservice (ex. Processor). It creates a single point of failure.
In the worst case (heavy load or other difficulties) Processor microservice could be unreachable. In that case, the Reader service would stop working, at least for some of the features. Also, it would be a performance leak for Reader service.
Previously in Invoice.Microservices.ThirdPartyAPIIntegration application, when a new invoice is added, I fire a queue to notify about that action first and do the invoice processing later on. And inside Reader microservice, I did the check to verify the status and do the following operation.
There is a reason behind this ugly operation, we need to call third party services, and our service bus could be unreachable. In that case, we lose the data consistency.
We can do the service bus call and third party service call inside a transaction. On service bus failure, it would not call the third party service and vice versa for third party service.