Hope someone can help here. So we’re writing a tool to replicate streams across event store clusters. Getting it working with the .Net client was pretty straight forward for the happy case, however if the source cluster drops out we want our application to recover automatically and continue. For some reason I’m struggling to get it working, I’ve tried a couple different things but currently I’m basically just reconnecting whenever the connection is closed and resubbing whenever a subscription is dropped.
I’ve attached the class that manages our connections and also the output from a unit test I’ve written around this (which includes the verbose event store connection logs as well as logs from our code so you can see when nodes are killed/restarted).
The section that jumps out at me from the logs is around line 359:
[26,14:50:39.661,DEBUG] Subscription {ca96555a-a082-4b13-badd-c05ce55b057f} to 288984f0-1f52-4482-a575-d11242cc2014: event appeared (288984f0-1f52-4482-a575-d11242cc2014, 0, test @ 875/875).
[26,14:50:39.661,DEBUG] EventStoreConnection ‘ES-c7c3e629-85a7-440a-a4e2-1a1ad36c44a2’: HandleTcpPackage SUBSCRIPTION DECISION DoNothing (StreamEventAppeared), Subscription VolatileSubscriptionOperation (ca96555a-a082-4b13-badd-c05ce55b057f): EventStore.ClientAPI.ClientOperations.VolatileSubscriptionOperation, is subscribed: True, retry count: 0, created: 14:50:37.836, last updated: 14:50:37.836.
[26,14:50:39.661,DEBUG] EventStoreConnection ‘ES-c7c3e629-85a7-440a-a4e2-1a1ad36c44a2’: HandleTcpPackage connId 748e5a8c-2469-4a93-a6f9-35f93592533e, package StreamEventAppeared, ca96555a-a082-4b13-badd-c05ce55b057f…
[26,14:50:39.661,DEBUG] Subscription {ca96555a-a082-4b13-badd-c05ce55b057f} to 288984f0-1f52-4482-a575-d11242cc2014: event appeared (288984f0-1f52-4482-a575-d11242cc2014, 1, test @ 1060/1060).
[26,14:50:39.661,DEBUG] EventStoreConnection ‘ES-c7c3e629-85a7-440a-a4e2-1a1ad36c44a2’: HandleTcpPackage SUBSCRIPTION DECISION DoNothing (StreamEventAppeared), Subscription VolatileSubscriptionOperation (ca96555a-a082-4b13-badd-c05ce55b057f): EventStore.ClientAPI.ClientOperations.VolatileSubscriptionOperation, is subscribed: True, retry count: 0, created: 14:50:37.836, last updated: 14:50:37.836.
[26,14:50:39.661,DEBUG] EventStoreConnection ‘ES-c7c3e629-85a7-440a-a4e2-1a1ad36c44a2’: HandleTcpPackage connId 748e5a8c-2469-4a93-a6f9-35f93592533e, package StreamEventAppeared, ca96555a-a082-4b13-badd-c05ce55b057f…
[26,14:50:39.661,DEBUG] Subscription {ca96555a-a082-4b13-badd-c05ce55b057f} to 288984f0-1f52-4482-a575-d11242cc2014: event appeared (288984f0-1f52-4482-a575-d11242cc2014, 2, test @ 1245/1245).
So are these the new events I’m posting? If so then they are seen but they get ignored and don’t trigger the StreamEventAppeared event?
Any help would be appreciated.
test output.txt (80.9 KB)
EventStoreConnectionManager.cs (10.6 KB)