FLOW_1:1) We send cmd22) Command Handler handles it, Loads the Group AR and adds the new member. The Group AR raises async event like UserJoinedGroupThe event is not part of the transaction (eventual consistence).3) Commit the transaction, write the UserJoinedGroup to the event store, whatever.4) At some point of time UserJoinedGroup is handled in DomainEventHandler and the new Activity is createdWell, now I want to replay the events from the ES. When the UserJoinedGroup is replayed it will create a new activity. May be this is correctbut not in all cases. What if we have a handler which sends and email or does something else that we do not want to be executed when eventsare replayed. How do you handle this?
Works fine for me.
Is there any thoughts about pros/cons of following way?
Cheers
2012/2/22 mynkow <myn...@gmail.com>
>
> about flow1: How to remove events that should not be replayed, like generating an activity? Is anyone doing ES or we are just talking?
>
> flow2: There is one common operation. The operation is AddUserToGroup. This operation is invoked by different parts of the application. Part 1 should also raise event, but part 2 should not. Kepp this in mind when you read the flow again
>
> Best regards
--
Dmitry
Rinat, just to clarify - as I understand you do following:
1) read events from persistent store
2) switch infrastructure to use temporary in-memory persistent store
3) replay all events readed from persistent store
4) switch infrastructure back to use normal store
Could you clarify that my understanding is correct?
BTW, I have said that you have used start/stop events to identify
replaing events priviously. Do you remeber/know approx. amount of
events when you run into perfomance problems with such events
replaying approach.
Many thanks,
Dmitry
2012/2/24 Rinat Abdullin <rinat.a...@gmail.com>:
--
Dmitry
I mean "BTW, *You* have said that you have used start/stop events to identify
replaing events priviously."
about flow1: How to remove events that should not be replayed, like generating an activity? Is anyone doing ES or we are just talking?
The only constraints you have when reapplying:
1) The target structure is a projection of a single events stream of a single Aggregate you need it in the same order the events where declared.
2) The target structure is a projection of multiple events streams each of a single Aggregate, the operation needs to be commutative. Meaning reapplying events/facts of Aggregate A followed by Aggregate B needs to be equal to reapplying events/facts of Aggregate B followed by Aggregate A.
3) If the case is not 1) or 2) probably you are missing an Aggregate in between that joins business activities performed by both A and B.
Cheers,
Nuno
2) selected projections are wired against in-memory store and events are streamed through (no message buses, just direct invocations).