Hi
I’m trying to setup a persistent subscription on my local dev machine. On the dashboard I can see the persistent subscription listed but the handler never gets called.
I run EventStore in docker:
docker run --name esdb-node -it -p 2113:2113 -p 1113:1113 -e EVENTSTORE_DEV=true eventstore/eventstore:latest --insecure --run-projections=All --enable-atom-pub-over-http
Appending the events:
await eventStoreClient.AppendToStreamAsync(
aggregate.Id.ToString(),
aggregate.Version == 0 ? StreamRevision.None : StreamRevision.FromInt64(aggregate.Version),
events);
Creating and subscribe to persistent subscription:
var client = new EventStorePersistentSubscriptionsClient(new EventStoreClientSettings {
CreateHttpMessageHandler = () =>
new HttpClientHandler
{
ServerCertificateCustomValidationCallback =
(message, certificate2, x509Chain, sslPolicyErrors) => true // ignore https
},
ConnectivitySettings = new EventStoreClientConnectivitySettings
{
Address = new Uri("http://127.0.0.1:2113?Tls=false&TlsVerifyCert=false")
}});
await client.CreateAsync("all", "TestGroup", new PersistentSubscriptionSettings(startFrom: StreamPosition.End));
await SubscribeAsync(client);
Console.ReadLine();
}
private static Task<PersistentSubscription> SubscribeAsync(EventStorePersistentSubscriptionsClient client)
{
return client.SubscribeAsync("all", "TestGroup",
(subscription, evt, retryCount, cancelToken) =>
{
Console.WriteLine("Received: " + Encoding.UTF8.GetString(evt.Event.Data.Span));
return Task.CompletedTask;
});
}
Console.WriteLine gets never called. What do I need to change?
Thanks
Dani