thenativeweb / node-cqrs-eventdenormalizer

Node-cqrs-eventdenormalizer is a node.js module that implements the cqrs pattern. It can be very useful as eventdenormalizer component if you work with (d)ddd, cqrs, domain, host, etc.
http://cqrs.js.org/pages/eventdenormalizer.html
MIT License
38 stars 27 forks source link

Dealing with missed events #55

Closed nanov closed 7 years ago

nanov commented 7 years ago

What is the recommended way to deal with missed events? I tried doing an RPC queue requesting those ( aggId, guardedRev, aggregateRev ) and the handling those one by one, but this approach seems to bring some problems with it ( mainly because of the handle inside handle ). Should i just send the missing events again thought the normal events queue ( send/receiver ) ?

adrai commented 7 years ago

Does this help? https://github.com/adrai/node-eventstore/issues/104 https://github.com/adrai/node-eventstore/issues/103

nanov commented 7 years ago

Well, I had already read those issues and proceeded in a similar manner. Actually my "problem" is simpler then i thought, what should be requested from the EventStore is guardedRevision-1 and aggregateRevision-1 from the info object. Then I process those one by one with the normal handle method ( as I make use of event extenders and preExtenders ), when done in this way everything seems to work as expected.

Is there any particular reason to call only the viewbuilders when replaying events? I am asking because I am thinking about adding it as an option.

adrai commented 7 years ago

Short answer: When replaying, only the readmodel should be rebuild... I.e. If you call another service during evtExtenders this should not be called again when rebuilding... -> you can't force everyone to handle rebuilts...

nanov commented 7 years ago

I see, it does makes sense, what about adding an option to the (pre)event extender to be replied?

adrai commented 7 years ago

should already => or not? https://github.com/adrai/node-cqrs-eventdenormalizer/blob/master/lib/replayHandler.js#L195

nanov commented 7 years ago

My bad, it absolutely does!