diff --git a/RabbitMQ.Stream.Client/Connection.cs b/RabbitMQ.Stream.Client/Connection.cs index e5c6a68e..a05cd58c 100644 --- a/RabbitMQ.Stream.Client/Connection.cs +++ b/RabbitMQ.Stream.Client/Connection.cs @@ -18,7 +18,7 @@ internal static class ConnectionClosedReason { public const string Normal = "TCP connection closed normal"; public const string Unexpected = "TCP connection closed unexpected"; - public const string MissingHeartbeat = "TCP connection closed missing heartbeat"; + public const string TooManyHeartbeatsMissing = "TCP connection closed by too many heartbeats missing"; } diff --git a/RabbitMQ.Stream.Client/HeartBeatHandler.cs b/RabbitMQ.Stream.Client/HeartBeatHandler.cs index 1097c5bd..e3217b6d 100644 --- a/RabbitMQ.Stream.Client/HeartBeatHandler.cs +++ b/RabbitMQ.Stream.Client/HeartBeatHandler.cs @@ -83,7 +83,7 @@ private async Task PerformHeartBeatAsync() // Even it is not a perfect solution, it is a good way to handle the case to avoid to introduce breaking changes // we need to review all the status and the close reason on the version 2.0 await _close($"Too many heartbeats missed: {_missedHeartbeat}. Client connection will be closed.", - ConnectionClosedReason.MissingHeartbeat).ConfigureAwait(false); + ConnectionClosedReason.TooManyHeartbeatsMissing).ConfigureAwait(false); } internal void UpdateHeartBeat() diff --git a/RabbitMQ.Stream.Client/Reliable/ReliableBase.cs b/RabbitMQ.Stream.Client/Reliable/ReliableBase.cs index 04110c23..de77230b 100644 --- a/RabbitMQ.Stream.Client/Reliable/ReliableBase.cs +++ b/RabbitMQ.Stream.Client/Reliable/ReliableBase.cs @@ -122,7 +122,7 @@ protected static ChangeStatusReason FromConnectionClosedReasonToStatusReason(str // Can be removed on the version 2.0 when the ConnectionClosedReason will be an enum as well return connectionClosedReason switch { - ConnectionClosedReason.MissingHeartbeat => ChangeStatusReason.DisconnectedByTooManyHeartbeatMissing, + ConnectionClosedReason.TooManyHeartbeatsMissing => ChangeStatusReason.DisconnectedByTooManyHeartbeatMissing, ConnectionClosedReason.Unexpected => ChangeStatusReason.UnexpectedlyDisconnected, _ => throw new ArgumentOutOfRangeException(nameof(connectionClosedReason), connectionClosedReason, null) };