Basic usage help


So… I have am trying to wrap my head around GES again!

I have a solution that has 2 consol apps in.

The first - mainly taken from the repository test project:

this creates an aggregate, raises some events and saves it. All good so far. I have some streams with names like:


The second is the subscriber:

I want this to listen for events coming out of the eventstore so that i can pretend to update a readmodel or two.

My understanding is that to do this I would subscribe to a stream.

Issue is SubscribeToAll yields an access denied error

SubscribeToStream wants the name of a stream…

which is troublesome as the stream names being created are agregateName-Id - so there appears to be a stream per aggregate instance? Can’t I just subscribe to all testAggregate or is there a way to subscibe to the events themselves?

Can anyone advice me on what my next steps should be?

I want to subscribe to all WoftamEvents so that I can update the WoftamReadModel or whatever I call it…

Hi Wayne,

You can use the credentials ‘admin’ and ‘changeit’ to subscribe to all (either in the defaults or on the subscription call)


By default $all (subscribe to all) is a system stream which requires system level privs. There are controllable defaults see Default ACLs here The default is that you should have admin access.

As such just provide credentials of your admin user (or change the default).



bah beat me


You’re doing ok on the Turing test btw - almost had me convinced :wink:

OK - brilliant

I can see my events are coming into the subscriber.

I now have a RecordedEvent coming into my read model

How do I get the data out of this so that i can decide what to do?

Do I deserialize the byte[] .Data?

How did you serialize them? :slight_smile:

If using the repository example I believe it uses json

Ok - cool - so the byte[] in Data will be JSON?

I believe so without reviewing the exact code you are using. From an Event Store perspective its just a byte [] and that is decided by you (though we recommend json :))

OK - so that’s cool and the gang…

Now I want to dial into another type of event - the wikiWikiWahJustHappenedEvent - in one place and then wikiWikiWahDidntJustHappen in another place…

How do I go about doing that?

Should I deserialize the events in a single place and route by convention or is there a better way to do it?


It depends - you could subscribe to $et-wikiWikiWahJustHappenedEvent etc and pass different handlers or you could dispatch yourself

Out of curiosity, by “wikiWikiWahDidntJustHappen”, do you mean “received 5 ‘minutepassed events’ without receiving a wikiWikiWahJustHappenedEvent”? Or something else…

It’s just another event. Absolutely no real world usage.

OK so I have the following:

connection.SubscribeToStream("$et-wikiWikiWahJustHappened", false,

(subscription, @event) => Console.WriteLine(“recieved!!” + @event.OriginalEvent.EventId),

(subscription, reason, arg3) => { }, new UserCredentials(“admin”, “changeit”));

but when I run the event producing console app nothing happens this side anymore?

what is the $et- part? are there any docs for this?

–run-projections=all from the command line

You have to run with --run-projections=all and enable the bytype projection in the admin ui

Thanks guys!

And thanks for being patient with me.


No worries. To help you along a bit, the internal projection that does the $et streams is the equivalent of:



$any : function(s,e) { linkTo(e.eventType, e); }


This makes a stream per event type which is quite useful in many scenarios as subscribers are interested in event type regardless of stream the event came into.