From 775fea8f469ce869824a244de83a97053bdb526d Mon Sep 17 00:00:00 2001 From: Desmond Cox Date: Wed, 9 Jul 2025 16:46:43 +0200 Subject: [PATCH] Remove warning log on dropped message Dropped messages can occur regularly. Depending on configuration / use case, this is even expected behavior. Logging a warning in the core NatsConnection potentially floods the logs with warnings and makes it difficult for clients to override. Logging on or otherwise handling dropped messages is better left for the user (i.e. by adding a custom MessageDropped event handler). --- src/NATS.Client.Core/NatsConnection.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NATS.Client.Core/NatsConnection.cs b/src/NATS.Client.Core/NatsConnection.cs index 2c18b2078..cc8a27f83 100644 --- a/src/NATS.Client.Core/NatsConnection.cs +++ b/src/NATS.Client.Core/NatsConnection.cs @@ -207,7 +207,6 @@ public async ValueTask ConnectAsync() public void OnMessageDropped(NatsSubBase natsSub, int pending, NatsMsg msg) { var subject = msg.Subject; - _logger.LogWarning("Dropped message from {Subject} with {Pending} pending messages", subject, pending); _eventChannel.Writer.TryWrite((NatsEvent.MessageDropped, new NatsMessageDroppedEventArgs(natsSub, pending, subject, msg.ReplyTo, msg.Headers, msg.Data))); }