[FEATURE] Add Saga capability #330
Labels
communications
🎲 database
Database-related operations
dependencies
Pull requests that update a dependency file
DI
enhancement
New feature or request
events
gitauto
GitAuto label to trigger the app in a issue.
good first issue
Good for newcomers
hacktoberfest
Participation in the Hacktoberfest event
help wanted
Extra attention is needed
IoC
🛠 WIP
Work in progress
Description
To enhance our command/event handling capabilities, we must integrate SAGA pattern support into the
CommandsConsumer
andEventsConsumer
classes.This will allow us to handle complex workflows involving multiple commands and events, manage long-running processes, and implement timeouts effectively.
Problem Statement
Impact: Without SAGA capabilities, managing long-running transactions and complex workflows becomes challenging, increasing the risk of inconsistencies and failures.
Proposed Solution
Implementation Steps
Triggering SAGA:
GenericSagaHandler
, that inherits from theISagaHandler
interface to start a SAGA when an initial event or command is received. It should function similarly to how current events and commands trigger handlers.ISagaData
interface.StartedBy<T>
that this class handles, it should have aHandle
method implemented.Handle<T>
that this class handles, it should have aHandle
method implemented.HandleTimeout<T>
that this class handles should have aTimeout
method implemented.Handling Multiple Messages:
Correlation and State Management:
Persistence:
Completion:
Timeout Feature:
Extend
ISaga
and ImplementISagaData
:ISaga
and implementsISagaData
to hold and manage SAGA details effectively.Testing:
Additional Notes
The text was updated successfully, but these errors were encountered: