Is it possible to implement two-phase transaction pattern if we want to get tasks execute in parallel instead of serial?
I mean, let us have two tasks: A, B. This tasks may be performed independently in parallel. A transaction is considered complete when both tasks, A and B, completed successfully. If task A succeeds but task B failed, then we should compensate task A. Can this behaviour be configured by means of Mass-Transit Courier?
CodePudding user response:
MassTransit Courier is a routing slip implementation in which activities are executed sequentially. There is no facility for parallel execution.
CodePudding user response:
There is a project that support parallel execution of tasks.
https://github.com/dtm-labs/dtm
https://github.com/dtm-labs/dtmcli-csharp
What you want is the saga pattern with the option Concurrent on.