I am currently investigating Mass Transit. I have written a simple sample based on the Starbucks sample.
I have the following saga:
Define(() =>
{
Initially(
When(ReportRequest)
.Then((saga, message) => saga.ProcessReportRequest(message))
.TransitionTo(WaitingForReportToComplete)
);
During(WaitingForReportToComplete, When(ReportComplete)
.Then((saga, message) =>
{
Console.WriteLine("Report Complete for '{0}'", saga.Name);
saga.CompleteReportRequest(message);
})
.Complete()
);
});
The problem I am having is that I have X subscribers to the ReportRequest
event and each subscriber create a small part of the report. Therefore, for the report to be considered complete all subscribers need to have issued a ReportComplete
event. At the moment the first subscriber to complete issues a ReportComplete
event and the saga then also completes.
How do I set up a saga so that it waits for all X subscribers to respond to a given message before completing?