I'm pretty new to CQRS and I have run into a question that I don't see a great way to solve in an event-driven architecture. Hope anyone can help me out with this!
The setup
Lets say I have broken down the system into smaller subsystems (domains) which are all separated in microservices over multiple physical machines.
Lets say we have a CRM system with the following entities: Customer, SalesPerson and Discussion.
For the sake of this example, each entity is part of a separate domain.
Discussions know about sales and customers.
Sales know about customers.
Customers doesn't know about any external domain / system.
In our UI we have an action which is "delete customer X".
The question
What we are trying to achieve is to inform the user about which effects the action might have (i.e. also deletes the related discussions) and give that user the opportunity to abort the action.
Is there a standard way to handle these scenarios?
One concern that I have is that the normal flow of actions is cascading asynchronously.
But the abort-scenario is synchronous in that we cannot proceed before we get an answer from external systems about the calculated effects.
In some way I feel that this scenario isn't really covered by the CQRS event pipe but rather a separate solution.
Kind regards
Richard
question from:
https://stackoverflow.com/questions/65927724/preventing-action-in-cqrs 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…