Replies: 3 comments
-
Can it really be that there is no way to do this? Why have separate streams at all if you can't subscribe to them separately? |
Beta Was this translation helpful? Give feedback.
-
To make it efficient to load events for specific aggregate (so it doesn't need to filter millions of events on every call).
The idea is that you subscribe to events, not streams. If you would subscribe to streams than you would need to create subscriptions dynamically and that would increase complexity a lot. It's much simpler to just filter by event attributes. And I think it applies to probably every implementation of event store as defined by Greg Young. |
Beta Was this translation helpful? Give feedback.
-
Greg's EventStore (mentioned here) implements this feature with server-side projections - https://eventstore.org/docs/projections/user-defined-projections/index.html RES does not have server side projections implemented. You need to implement the projection by yourself. There is no way to subscribe for events from selected stream (however the idea seems interesting). You need to implement your builder to read from the given stream and process events periodically. It need to store last processed event id and next time it runs it should read only new domain events linked to stream. The (pseudo) code could look like:
|
Beta Was this translation helpful? Give feedback.
-
I asked my question over at StackOverflow.
Would be very nice if you had some answers for me.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions