Closed perikarion closed 12 years ago
The events are dispatched as a part of the event store pipeline.
You can't dispatch from within AR, because the dispatch needs to happen after ACK from DB, of them having been saved, or you are forced to use 2PC transports.
Hope this clarifies things. I'm closing this issue, unless you have further questions.
Thanks thats it, point six is what I was missing.
I've been struggling with this issue quite long. According to CommonDomain source code events are dispatched via ApplyEvent method in AggregateBase class. For example when CreateCustomerCommandHandler is called, then Created event is dispatched. But when you comment out repo.Save(client, CombGuid.Generate(), null); line in Consume method in the same handler, events are not dispatched. Should't dispatching of events be independent from repository.Save method and should't be performed inside Aggregat Root (Customer in this case) or am I missing something?