-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nested sagas #82
Comments
Builds on eventuate-tram/eventuate-tram-core#179 |
Design overviewSee NestedSagaTest and other classes in that package. There are two sagas:
SagaCommandHandler (part of
|
…cer) and eventuate-foundation/eventuate-common#118 (IdGenerator signature)
We are doing something similar to this with eventuate where we have a high level saga (what we have been calling the parent saga) which initiates child sagas in other services. This works out the box but it has the problem that the parent saga doesn't know when or if the child saga completes successfully. It just starts the child saga and then carries on. Our solution has been to consume the command from the parent saga using a simple message consumer subscription (instead of an eventuate command handler), where we then start the saga and we set the command message headers to the saga data object. Then we have an observer hooked in to our saga which listens for a success or rollback and at that point sends the relevant reply. This means that the parent saga doesn't complete until the child saga completes and if the child saga rolls back then it causes the parent saga to rollback. There is still one problem with this solution which is if you have multiple child sagas and a later child saga rolls back after a previous child saga has completed then we will need to create a separate mechanism to roll back the previously completed child saga. |
Currently
Proposed:
Support saga command handlers that
SagaReplyInfo
- that contains the data needed to construct a reply, e.g. message headers etc.SagaReplyInfo
can be passed to a SagaonXXX()
- can use theSagaReplyInfo
to send a reply to the commandThe text was updated successfully, but these errors were encountered: