Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Subscriptions

322 views
Skip to first unread message

Daniel Nauck

unread,
Oct 30, 2013, 6:29:44 AM10/30/13
to event...@googlegroups.com
Hello,

on application startup i'm subscribing with the C# client to all events i'm interested in with $et-<EventName> using SubscribeToStreamFrom(...).

But in the early stage of the application lifetime not all events are in the event store (like e.g. CustomerDisabled). And i get a CatchUpError with an access denied exception. Not very helpful because i want to subscribe and handle them as soon as such an event is fired.

How can i subscribe to such events?

Greg Young

unread,
Oct 30, 2013, 7:15:41 AM10/30/13
to event...@googlegroups.com
A catch up subscription will deliver them as they happen perhaps you can share your code? What user is the subscription being connected as?
--
You received this message because you are subscribed to the Google Groups "Event Store" group.
To unsubscribe from this group and stop receiving emails from it, send an email to event-store...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
Le doute n'est pas une condition agréable, mais la certitude est absurde.

James Nugent

unread,
Oct 30, 2013, 7:55:16 AM10/30/13
to <event-store@googlegroups.com>, event...@googlegroups.com
If it's subscribing to $et-whatever you will need to authenticate as ACL for system streams is admin only by default iirc. admin/changeit are the defaults.

However it seems you're likely on a wrong course with subscribing like that, if you can share your code we can probably help.


James

Sent from my iPhone

Daniel Nauck

unread,
Oct 30, 2013, 8:18:26 AM10/30/13
to event...@googlegroups.com
Hello,

the EventStore is just running local and used without credentials for now.

The sample code for the dispatcher is available here: https://gist.github.com/dnauck/7231622

Each event handler (read model projections, etc) registers all events that it is handling in the dispatcher and then it add a subscription to $et-<NameOfEvent>.

The SubscribeToAllFrom(..) was not working, as it also required admin permissions. And i don’t want to subscribe to all events, just the ones i need.

Thanks for your help.

Daniel

Greg Young

unread,
Oct 30, 2013, 8:27:15 AM10/30/13
to event...@googlegroups.com
You are passing in the connection to this code. If I understand you properly you are not setting credentials on it. To read system streams such as $et or $all you need to have admin privs (or change the default acls to allow it). Try setting user credentials of user:changeit on your connection and things should work. Alternatively instead of using $et streams you could write your own projection that writes to user space streams and set privs on them how you see fit via stream metadata


Should be useful.

Cheers,

Greg

Daniel Nauck

unread,
Oct 30, 2013, 8:50:36 AM10/30/13
to event...@googlegroups.com
Hi Greg,

thank you. It works now.

I'm using the sample projection from your blog:

fromAll().
    when({
        $any : function(s,e) { linkTo("EventType-" + e.type, e); }
    });

But is this the way to go in general or do you suggest any other way to go when subscribing to events?

Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to event-store+unsubscribe@googlegroups.com.


--
Le doute n'est pas une condition agréable, mais la certitude est absurde.

--
You received this message because you are subscribed to the Google Groups "Event Store" group.
To unsubscribe from this group and stop receiving emails from it, send an email to event-store+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Event Store" group.
To unsubscribe from this group and stop receiving emails from it, send an email to event-store+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Event Store" group.
To unsubscribe from this group and stop receiving emails from it, send an email to event-store+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Greg Young

unread,
Oct 30, 2013, 9:35:48 AM10/30/13
to event...@googlegroups.com
If you want it in user space that's correct. If you are running the $et system projection though you probably prefer to just use it's streams as otherwise you do all the same work twice :) just adding the credentials (or creating a different user and giving them admin rights) will allow you to subscribe to the system streams.

Cheers.

To unsubscribe from this group and stop receiving emails from it, send an email to event-store...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages