How can I create a persistent subscription to all streams?

Hi,

I would like to have a persistent subscription for all streams. I’ve tried with stream name $all but that doesn’t seem to work.

How can I achieve this?

Thanks
Dani

Have not found any workaround to this, and had to create my own ‘all’-projection.

Which client are you using?
On the C# client, there is a SubscribeToAllAsync method.

@steven.blair I’m using the C# client. But SubscribeToAllAsync is not a persistent subscription, right?

@peter.hageus can one create a persistent subscription based on a projection? Isn’t it limited to streams?

Our projection writes link-to’s to a stream (named ‘all’), so technically it is a stream.

@peter.hageus I see, I’m not yet so experienced with EventStore projections. Is possible for you to share the code for the projection?

Hi,

Persistent subscriptions don’t support subscriptions to $all, if you need to subscribe to $all please use SubscribeToAllAsync and track checkpoints in your own application. Filtered subscriptions to $all are also now available from version 20.6.0.

Creating a projection that links every event in $all is really not recommended.
This will write at least one new event for every event that gets written to your system.

LinkTo events also have performance implications as they cause a double read for each event.

Persistent subscriptions have very different semantics from regular catchup (scale-out, retries, etc). Really can’t see them being used for the same purposes.

To clarify, we used to use regular subscriptions for process managers, but when persistent subscriptions was introduced it was a big step forward. We couldn’t scale out, had to build our own solution for parking and retrying, visibility etc.

This response, plus some comments from James a while ago, makes me suspect they are not a top priority in the future?

@peter.hageus I’m glad to hear you found them to be a good step forward.

I can say they will continue to be a priority going forward, and will be the focus of more development effort.

Persistent subscriptions for $all is something we plan to address relatively soon.

1 Like

Good to hear, I’m really looking forward to have that. I think it is a great benefit to not track checkpoints in the application.

1 Like