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

replayStreamed not committing into the database #63

Closed alemhnan closed 7 years ago

alemhnan commented 7 years ago

I'm running the replayStreamed function and I have issues in getting it working. Apparently, the viewBuilders are not committing the data during each replay. Therefore if to denormalize event 2 I need to lookup data already denormalized in event 1 it fails because it is not committed yet in the database.

Am I doing something obviously wrong? or maybe you are caching the views and committing in batches?

Do you have any hint how to approach this case?

adrai commented 7 years ago

Do you have a unit test to reproduce it?

alemhnan commented 7 years ago

Not yet. Monday morning I'll isolate the behaviour and publish in a repo. I'll keep you posted.

On 22 Sep 2017, 17:42, at 17:42, Adriano Raiano notifications@github.com wrote:

Do you have a unit test to reproduce it?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/adrai/node-cqrs-eventdenormalizer/issues/63#issuecomment-331483508

alemhnan commented 7 years ago

Hello,

I created a repo (https://github.com/alemhnan/UT) that reproduce my issues. There are two commands with one event each.

On npm start the two commands will be issued. Then the reply will be run. If you try you will see an error in console.

It does connect to a mongodb, default set as: mongodb://localhost:27017/eventstore and mongodb://localhost:27017/denormalize

adrai commented 7 years ago

https://github.com/alemhnan/UT/commit/2efb0fdb2ea35043087e48db3cafb922d07a4d50#commitcomment-24545792

alemhnan commented 7 years ago

That did the trick. Thanks a lot!