Search code examples
eventstoredb

EventStore Persistent Subscription Event Data


I am successfully connecting to an EventStore persistent subscription and using the EventStore ClientAPI in C#, I receive events. Everything is good except rather than receive the original event data in my ResolvedEvent I receive a reference to the event in the form <event_number>@<stream_Id>.

This is OK but to retrieve the event and process it requires me to do another trip to the EventStore and request the event using

ReadEventAsync(string stream, long eventNumber, bool resolveLinkTos);

Is there a way to receive the actual event data from the persistent subscription?


Solution

  • You need to add ResolveLinkTos() when creating a persistent subscription. This code works:

    var subscriptionSettings = PersistentSubscriptionSettings.Create()
        .StartFromBeginning()
        .ResolveLinkTos()
        .WithMaxRetriesOf(_retryCount);