Ok, is there any way to implement this sort of behavior then? Users are importing entities. I want an action to occur on each entity import and another action to occur when the import is 100% complete. I assumed sagas would be the best way to handle this. But I need to allow users to perform multiple imports as well as possible simultaneous imports (multiple users importing at the same time - edge case). The import files can be quite large to where putting all of the entities in a single message can easily exceed the limitations of msmq.
Just looking for ideas. Thanks for the response. On Sat, May 5, 2012 at 6:40 AM, Oren Eini (Ayende Rahien) <[email protected] > wrote: > Once the saga is completed, it is just that, completed, done. > This is the by design behavior. > > > > On Fri, May 4, 2012 at 10:17 PM, RyanL <[email protected]> wrote: > >> I have a saga. Once it completes the saga consumer disappears and >> future messages get an error "Got Message X, but had no consumers for >> it". What do I do to leave the consumer / subscription active and >> just start a new saga? Here is my class: >> >> public class OutcomeImportSagaLuceneIndexer : >> ISaga<OutcomeImportState>, >> >> InitiatedBy<OutcomeImportStartedEvent>, >> >> Orchestrates<OutcomeImportedEvent> >> { >> private readonly ILuceneRepository<OutcomeListModel> >> repository; >> >> public >> OutcomeImportSagaLuceneIndexer(ILuceneRepository<OutcomeListModel> >> repository) >> { >> this.repository = repository; >> State = new OutcomeImportState(); >> } >> >> public void Consume(OutcomeImportStartedEvent message) >> { >> State.OutcomesToImport = message.OutcomesToImport; >> } >> >> public void Consume(OutcomeImportedEvent message) >> { >> repository.Upsert(MapToLuceneListRecord(message.Outcome)); >> State.OutcomesImported++; >> if (State.OutcomesImported < State.OutcomesToImport) >> return; >> >> repository.RebuildIndex(); >> IsCompleted = true; >> } >> >> private static OutcomeListModel >> MapToLuceneListRecord(OutcomeViewModel model) >> { >> return Mapper.Map<OutcomeViewModel, >> OutcomeListModel>(model); >> } >> >> public Guid Id { get; set; } >> public bool IsCompleted { get; set; } >> public OutcomeImportState State { get; set; } >> } >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Rhino Tools Dev" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/rhino-tools-dev?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Rhino Tools Dev" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rhino-tools-dev?hl=en. > -- You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.
