revoframework / Revo

Event Sourcing, CQRS and DDD framework for C#/.NET Core.
https://docs.revoframework.net/
MIT License
654 stars 70 forks source link

Why aren't events removed from the queue? #34

Closed RustamGulamov closed 3 years ago

RustamGulamov commented 3 years ago

Can't figure out why events are not deleted from DB after Projector.Commit. After all, these events are not needed after the commit Projectors.

Is it bug ?

image

martinzima commented 3 years ago

What you are seeing are not events, but event queues. We need those to keep track of the last event that was processed in every queue (basically, it's used to guarantee idempotent event processing, detect when events arrive out-of-order, etc.).

EDIT: Also, if you are worried about performance, you can use EFCoreSyncEntityEventToPocoProjector or EFCoreSyncEntityEventProjector instead. This uses a shortcut code path for the projections and the events are not enqueued at all (it all happens synchronously in one transaction, then).

RustamGulamov commented 3 years ago

How a configure projectors for commit to readStore ? I have ReadStore and EventStore. I could not configure projections if ReadModels(tables for read) are in another database.