kgrzybek / modular-monolith-with-ddd

Full Modular Monolith application with Domain-Driven Design approach.
MIT License
11.14k stars 1.75k forks source link

Impossible to rollback business scenario in case of fail #52

Open denis-tsv opened 4 years ago

denis-tsv commented 4 years ago

It is needed to invent some way to rollback failed business scenarios. For example scenario "create meeting group proposal" started at meetings module and finished at administration module. When meetings module created meeting group proposal then controller returned Ok result. But if creation of meeting group proposal in admin module failed then proposal will newer be accepted. If creation of proposal failed in admin module then we need to send a message to messages module about it. After that meeting module can show to proposal creator information about fail (something like that "Something wrong with your proposal. Please try to resubmit it.")

plalx commented 3 years ago

Haven't checked the specifics, but the Inbox/Outbox patterns guarantees at least once message processing meaning that if there's a command processing error, the command will be retried until it succeeds (e.g. bug fixed) to guarantee eventual consistency.