This repository was archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 141
Resiliency: failure in output bindings? #3
Copy link
Copy link
Open
Description
I've been going through your example code and I've been wondering about the following.
Inside the TransferCommandProcessor multiple CheckingAccountLine documents are being written to Cosmos via the CosmosDB-output binding of the TransferMoney-Azure Function. Additionally a TransferSucceededEvent is sent to EventHub.
What would happen if an error would occur in the processing of one of these output bindings?
I would assume the following:
- If the 2nd
AddAsyncon the Cosmos binding fails, you'd end up with the money being removed from one account, but not added to the other. I don't see any code path that will undo this document. In fact, if the transfer would be compensated via theCancelTransferCommandthen money would be incorrectly removed from the receiving account. - If the EventHub-binding fails at the end of the Azure Function execution (which I assume is possible?), then we'd never get a
TransferFailedEventorTransferSucceededEventeventhough the transfer will have taken place (without a receipt). If this would cause a retry, then twice the intended amount would be transferred.
Could you clarify if my assumptions are correct?
Metadata
Metadata
Assignees
Labels
No labels