diff --git a/src/content/docs/dotnet-next/infra/esdb.md b/src/content/docs/dotnet-next/infra/esdb.md index 2447247..dc7f7c2 100644 --- a/src/content/docs/dotnet-next/infra/esdb.md +++ b/src/content/docs/dotnet-next/infra/esdb.md @@ -221,6 +221,34 @@ builder.Services.AddSubscription::-parked` and contains *link* events, so reads must use `resolveLinkTos: true` to retrieve the original payloads: + +```csharp +var parked = client.ReadStreamAsync( + Direction.Forwards, + $"$persistentsubscription-{streamName}::{subscriptionId}-parked", + StreamPosition.Start, + resolveLinkTos: true +); +``` + +To override the default behaviour, set `FailureHandler` on the options. For example, to park immediately without retries: + +```csharp +options.ThrowOnError = true; +options.FailureHandler = (_, sub, re, ex) + => sub.Nack(PersistentSubscriptionNakEventAction.Park, ex.Message, re); +``` + ## Producer In a prototype or small-scale production application, you can use KurrentDB as a message broker. In that case, you can use the `KurrentDBProducer` to publish events to the database. Unlike the aggregate store, [producers](../../producers) allow publishing events that aren't necessarily domain events.