Closed abuzaforfagun closed 2 years ago
Previously I used to call InvoiceProcessor from NewInvoiceAddedHandler to make sure the invoice is already processed or not.
Because, inside SendInvoice command handler, I fire the NewInvoiceAdded first and call the client afterward.
There is a reason behind this, our distributed handler call could fail because of network latency or when the Azure server is down. We did not follow any way around to revert that service bus call.
But we can use the nested transactions to fix the issue and it will remove the necessity to call the Invoice Processor service from Invoice Reader.
InvoiceReader service is dependent on InvoiceProcessor. As
NewInvoiceAddedHandler
is making HTTP requests to InvoiceProcessor to get the status of the invoice. When InvoiceProcessor is unreachable, InvoiceProcessor would fail to remove the cache. It could be a single point of failure.We need to remove the direct dependency of InvoiceProcessor from the InvoiceReader service.