Is it that possible to start different sagas with the same started message and the same endpoint?
For example i want to handle a message "user-signed-in".
And i have a 2 different sagas which should start with the above message:
That sagas are completly diffrenet and have different class name & saga data class name.
And question is: will both sagas start when "user-signed-in" message come?
A single message received by an endpoint can start multiple sagas.
You will need to mark both sagas as started by that message type. For example:
public class UserSessionSaga : IAmStartedByMessages<UserSignedIn>...
and
public class UserPurchasesSaga : IAmStartedByMessages<UserSignedIn>...
UserSessionSaga
will be completed by an event (signing out) that is different from an event completing UserPurchasesSaga
. For that, you'll have to specify what additional messages each saga can handle using IHandleMessages<T>
and correlate all the messages each saga can handle. See documentation here for the syntax.