I have an esdb running in docker via
docker run --name esdb-node -it -p 2113:2113 -p 1113:1113 eventstore/eventstore:latest --insecure --run-projections=All --enable-external-tcp --enable-atom-pub-over-http --log-http-requests
I have a .NET app receiving the events from UI and a projection service.
The projection service is listening to all stream via this code
_eventStoreClient.SubscribeToAllAsync
and a resubscribe method like this on SubscriptionDrop
private void DroppedSubscriptionAll(StreamSubscription subscription, SubscriptionDroppedReason droppedReason, Exception? exception)
{
if (droppedReason != SubscriptionDroppedReason.Disposed)
{
subscription.Dispose();
Subscribe().Wait(cancellationTokenSource.Token);
}
}
Connection retry is present via Polly like
private async Task Subscribe()
{
var retry = Policy
.Handle<Exception>()
.WaitAndRetryForeverAsync(retryAttempt => TimeSpan.FromSeconds(
retryAttempt*2),
(exception, _) => { }
);
await retry.ExecuteAsync(async () => await SubscribeToAll(cancellationTokenSource.Token));
}
When i work with 1 or two events its all looking good; but as soon as I send like a 1000 events all at once, the client starts to log the error message like
Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: An error occurred while sending the request. IOException: The request was aborted. Http2StreamException: The HTTP/2 server reset the stream. HTTP/2 error code 'ENHANCE_YOUR_CALM' (0xb).", DebugException="System.Net.Http.HttpRequestException: An error occurred while sending the request.
The esdb logs are suggesting its subscribing and then dropping the subscribe immediately;
[ 1,61,08:44:13.206,INF] Catch-up subscription bc0aedb6-454e-47d1-9550-5c8a7be23829 to $all:“StreamIdPrefixStrategy: (streamone-)”@“C:537157/P:0” running…
[ 1,61,08:44:13.522,INF] Live subscription 48a5bcbf-036a-4d89-9a55-f18c95e91a28 to $all:“StreamIdPrefixStrategy: (streamone-)” disposed.
How can I make sure the client is connecting properly?