Hello,
i’ve implemented my event dispatcher like described in this post [1].
It iterate over all event types in my application and is using
SubscribeToStreamFrom(string.Concat("$et-", eventType.Name), …);
It also stores the last successful processed event id and subscribes on the next startup again from this position.
This implementation has the advantage to receive only “my” events from the GetEventStore and the flexibility to replay only all events from a specific type.
But if’ve one subscription for each event type in my application. Is it bad to have “so many” subscriptions with the C# client?
I also have to deal with out of order events, e.g. CustomerRelocated arrived before CustomerCreated. The easiest way was to fail with an exception in the EventAppeared handler and then to restart the subscription from the last working position (in hope the CustomerCreated event arrived in the meantime). What do you recommend to handle this?
Another idea was to use the $ce- projection and subscribe to each aggregate type of my application, where i get all events from this aggregate in order. But its less flexible then the $et- approach and i could still have out of order events in my read model.
Or using the $all stream … but then i receive tons of events that i’m not interested in, e.g. stats or stuff like $$$et-$statsCollected, $$$et-$metadata, …
What is a recommend way to go?
Thanks.
[1] https://groups.google.com/d/msg/event-store/fC9O1d0GnEc/9e5DbaHtL3cJ