Skip to content

Commit

Permalink
Better integrate max message size
Browse files Browse the repository at this point in the history
Fixes #1223 for 6.x
  • Loading branch information
lukebakken committed Jun 13, 2022
1 parent fd95377 commit d8721fe
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_site/

###################
## Generated files
###################
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## Changes Between 6.3.1 and 6.4.0

This release adds the ability to specify a maximum message size when receiving data. The default
values are:

* RabbitMQ .NET client 7.0.0 and beyond: 128MiB
* RabbitMQ .NET client 6.4.0 up to 7.0.0: no limit by default

Receiving a frame that specifies a content larger than the limit will throw an execption.


To set a limit, use the `AmqpTcpEndpoint` API and set `MaxMessageSize` before opening connections:

```
// This sets the limit to 512MiB
var ep = new AmqpTcpEndpoint("host", 5672) { MaxMessageSize = 536870912 };
var cf = new ConnectionFactory();
var conn = cf.CreateConnection(new List<AmqpTcpEndpoint> { ep });
```

GitHub milestone: [`6.3.1`](https://github.com/rabbitmq/rabbitmq-dotnet-client/milestone/58?closed=1)
Diff: [link](https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v6.3.1...v6.4.0)

## Changes Between 6.3.0 and 6.3.1

GitHub milestone: [`6.3.1`](https://github.com/rabbitmq/rabbitmq-dotnet-client/milestone/57?closed=1)
Expand Down
5 changes: 5 additions & 0 deletions projects/RabbitMQ.Client/client/api/ConnectionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public sealed class ConnectionFactory : ConnectionFactoryBase, IConnectionFactor
/// </summary>
public const uint DefaultFrameMax = 0;

/// <summary>
/// Default value for the desired maximum frame size. Default is 0 ("no limit").
/// </summary>
public const uint DefaultMaxMessageSize = 0;

/// <summary>
/// Default value for desired heartbeat interval. Default is 60 seconds,
/// TimeSpan.Zero means "heartbeats are disabled".
Expand Down

0 comments on commit d8721fe

Please sign in to comment.