From 68413507f96191c665efa7cbdb48bfc37c2508e8 Mon Sep 17 00:00:00 2001 From: davidda Date: Wed, 27 Aug 2025 10:07:30 +0200 Subject: [PATCH] bugfix --- projects/RabbitMQ.Client/AmqpTcpEndpoint.cs | 2 +- projects/RabbitMQ.Client/InternalConstants.cs | 4 ++-- projects/Test/Integration/TestConnectionFactory.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/RabbitMQ.Client/AmqpTcpEndpoint.cs b/projects/RabbitMQ.Client/AmqpTcpEndpoint.cs index 4778ccbb8..5dfb87530 100644 --- a/projects/RabbitMQ.Client/AmqpTcpEndpoint.cs +++ b/projects/RabbitMQ.Client/AmqpTcpEndpoint.cs @@ -78,7 +78,7 @@ public AmqpTcpEndpoint(string hostName, int portOrMinusOne, SslOption ssl, _port = portOrMinusOne; Ssl = ssl; _maxInboundMessageBodySize = Math.Min(maxInboundMessageBodySize, - InternalConstants.DefaultRabbitMqMaxInboundMessageBodySize); + InternalConstants.MaximumRabbitMqMaxInboundMessageBodySize); } /// diff --git a/projects/RabbitMQ.Client/InternalConstants.cs b/projects/RabbitMQ.Client/InternalConstants.cs index 105ce297b..13019db68 100644 --- a/projects/RabbitMQ.Client/InternalConstants.cs +++ b/projects/RabbitMQ.Client/InternalConstants.cs @@ -41,9 +41,9 @@ internal static class InternalConstants /// /// Largest message size, in bytes, allowed in RabbitMQ. /// Note: rabbit.max_message_size setting (https://www.rabbitmq.com/configure.html) - /// configures the largest message size which should be lower than this maximum of 128MiB. + /// configures the largest message size which should not be higher than this maximum of 512MiB. /// - internal const uint DefaultRabbitMqMaxInboundMessageBodySize = 1_048_576 * 128; + internal const uint MaximumRabbitMqMaxInboundMessageBodySize = 1_048_576 * 512; /// /// Largest client provide name, in characters, allowed in RabbitMQ. diff --git a/projects/Test/Integration/TestConnectionFactory.cs b/projects/Test/Integration/TestConnectionFactory.cs index 3a17efcd9..f8f83d08f 100644 --- a/projects/Test/Integration/TestConnectionFactory.cs +++ b/projects/Test/Integration/TestConnectionFactory.cs @@ -320,8 +320,8 @@ public async Task TestCreateConnectionUsesValidEndpointWhenMultipleSupplied() public void TestCreateAmqpTCPEndPointOverridesMaxMessageSizeWhenGreaterThanMaximumAllowed() { var ep = new AmqpTcpEndpoint("localhost", -1, new SslOption(), - 2 * InternalConstants.DefaultRabbitMqMaxInboundMessageBodySize); - Assert.Equal(InternalConstants.DefaultRabbitMqMaxInboundMessageBodySize, ep.MaxInboundMessageBodySize); + 2 * InternalConstants.MaximumRabbitMqMaxInboundMessageBodySize); + Assert.Equal(InternalConstants.MaximumRabbitMqMaxInboundMessageBodySize, ep.MaxInboundMessageBodySize); } [Fact]