Subscriptions - How with CommonDomain?

Hello,

i’m using the GetEventStoreRepository of the getting started git repository.

Now i want to subscribe with my read side to all streams from all my aggregates (and/or projections).

The C# API has only SubscribeToStream(, …) and SubscribeToAll(…).

I don’t know the name of the streams because they are named “aggregate-” and it could be a very large list of streams.

The SubscribeToAll(…) also does not work, because it will also subscribe to streams where only the admin user has access to.

I was using this blog post as a starting point:

http://geteventstore.com/blog/20130607/catch-up-subscriptions-with-the-event-store/

So, how do i subscribe to all events from my GetEventStoreRepository?

Thanks.

Subscriptions should respect the rights of the user subscribing. However if there are other reasons for not wanting to subscribe to all you could have a projection creating a single stream of events you’re interested in.

Also, you likely don’t want to be subscribing in a repository (that’s a bit weird) - you likely want to be using SubscribeToAllFrom().

James

Subscribe to all will give all events even admin ones. I’m curious, what is the issue with the read model getting and ignoring these events? Is there a security concern for that code or?

Hello,

the SubscribeToAll(…) does try to subscribe to all streams, even streams i do not have access to. I got a access denied exception.

The goal is to subscribe to all Events of type XYZ on the read side (e.g. a class that subscribes to created, renamed, etc. events for a special aggregate and builds a list of them as read model). But the C# API only provide to subscribe by stream, not by eventType. Ok, i could use “$et-EventType”.

How do you guys implement this. Is there a recommend way?