Skip to content

Commit 4e5a405

Browse files
Merge pull request #795 from rabbitmq/rabbitmq-dotnet-client-793
Change log and basic doc updates for 6.x
2 parents f540a8f + ba97c22 commit 4e5a405

File tree

7 files changed

+168
-62
lines changed

7 files changed

+168
-62
lines changed

CHANGELOG.md

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,77 @@
11
## Changes Between 5.2.0 and 6.0.0
22

3-
Please see the milestone for all changes:
3+
This major release of this client introduces substantial improvements
4+
in terms of memory footprint and throughput. They come at the cost
5+
of minor but important **breaking API changes** covered below.
6+
7+
The client now requires .NET Framework 4.6.1 or .NET Standard 2.0.
8+
Earlier versions are no longer supported by the `6.x` series.
9+
10+
Key improvements in this release have been the result of hard work by
11+
our stellar community members (in no particular order): @stebet, @bording,
12+
@Anarh2404, @danielmarbach, and others.
13+
14+
A full list of changes can be found in the GitHub milestone: [`6.0.0`](https://github.com/rabbitmq/rabbitmq-dotnet-client/milestone/41?closed=1).
15+
16+
### The Switch to System.Memory (and Significantly Lower Memory Footprint that Comes with It)
17+
18+
The client now uses the [`System.Memory` library]() for message and command payloads. This significantly
19+
reduces object allocation and GC pressure for heavy workloads but also
20+
**potentially requires application changes**: consumer delivery payloads are now of instance [`System.ReadOnlyMemory<byte>`](https://docs.microsoft.com/en-us/dotnet/api/system.readonlymemory-1?view=netcore-3.1)
21+
instead of `byte[]`.
22+
23+
While there's an implicit conversion for these types,
24+
instances of `System.ReadOnlyMemory<byte>` **must be copied or consumed/deserialised before delivery handler completes**.
25+
Holding on to delivered payloads and referencing them at a later point **is no longer safe**.
26+
27+
The same applies to publishers and the `IModel.BasicPublish` method: prefer using `System.ReadOnlyMemory<byte>`
28+
over `byte[]` and dont' assume that this memory can be retained and used outside of the scope of the publishing
29+
function.
30+
31+
GitHub issue: [#732](https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/732)
32+
33+
### Timeouts Use `System.TimeSpan`
34+
35+
All timeout arguments now use `System.TimeSpan` values.
36+
37+
GitHub issue: [#688](https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/688)
38+
39+
### Reduced Public API Surface
40+
41+
No major changes here but this is potentially breaking. Only public classes that were never meant
42+
to be publicly used have been turned internal to the client.
43+
44+
GitHub issue: [#714](https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/714)
45+
46+
### Requires .NET Framework 4.6.1 or .NET Standard 2.0
47+
48+
The client now requires .NET Framework 4.6.1 or .NET Standard 2.0. Earlier versions are no longer
49+
supported.
50+
51+
GitHub issue: [#686](https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/686)
52+
53+
### `Microsoft.Diagnostics.Tracing.EventSource` Dependency Dropped
54+
55+
`Microsoft.Diagnostics.Tracing.EventSource` dependency has been removed. It was an annoying
56+
dependency to have for some environments.
57+
58+
### Source Linking
59+
60+
The library now supports source linking.
61+
62+
GitHub issue: [#697](https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/697)
63+
64+
### NuGet Source Packages
65+
66+
Source packages are now also distributed via NuGet.
67+
68+
### CRL Checks for Server x.509 (TLS) Certificates
69+
70+
Added a TLS option to enforce CRL checks for server certificates.
71+
72+
GitHub issue: [#500](https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/500)
73+
474

5-
[GitHub `6.0.0` Milestone](https://github.com/rabbitmq/rabbitmq-dotnet-client/milestone/41?closed=1)
675

776
## Changes Between 5.1.2 and 5.2.0
877

@@ -14,13 +83,14 @@ Selected highlights:
1483

1584
### Add support for `netstandard2.0`
1685

17-
GitHub Issue: https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/428
18-
GitHub PR: https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/435
86+
GitHub issues: [#428](https://github.com/rabbitmq/rabbitmq-dotnet-client/issues/428), [#435](https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/435)
1987

2088
### Re-introduce lock for all socket writes
2189

2290
GitHub PR: [rabbitmq-dotnet-client#702](https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/702)
2391

92+
93+
2494
## Changes Between 5.1.1 and 5.1.2
2595

2696
### Bump System.Net.Security to 4.3.2

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
## RabbitMQ .NET Client [![Build status](https://ci.appveyor.com/api/projects/status/33srpo7owl1h3y4e?svg=true)](https://ci.appveyor.com/project/rabbitmq/rabbitmq-dotnet-client)
1+
## RabbitMQ .NET Client
2+
3+
* AppVeyor: [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/33srpo7owl1h3y4e?svg=true)](https://ci.appveyor.com/project/rabbitmq/rabbitmq-dotnet-client)
4+
* TravisCI: [![Travis CI Build Status](https://travis-ci.org/rabbitmq/rabbitmq-dotnet-client.svg?branch=master)](https://travis-ci.org/rabbitmq/rabbitmq-dotnet-client)
25

36
This repository contains source code of the [RabbitMQ .NET client](https://www.rabbitmq.com/dotnet.html).
47
The client is maintained by the [RabbitMQ team at VMware](https://github.com/rabbitmq/).
58

6-
## Dependency (Binaries and Nuget Artifact)
9+
10+
## Dependency (NuGet Artifact)
711

812
### Modern Versions
913

1014
The client is [distributed via NuGet](https://www.nuget.org/packages/RabbitMQ.Client/).
1115

12-
### Legacy Versions
13-
14-
`3.6.x` and earlier releases were distributed [together with RabbitMQ server 3.6.x](https://github.com/rabbitmq/rabbitmq-server/releases/)
15-
as archives.
16-
17-
[Release archive up to 3.4.3](https://bintray.com/rabbitmq/archive/rabbitmq-dotnet-client) is available from Bintray.
18-
1916

2017
## Tutorials and Documentation
2118

@@ -26,7 +23,10 @@ as archives.
2623

2724
## Supported Platforms and .NET Releases
2825

29-
Future `6.x` versions of the library require .NET 4.6.1 or a .NET Core version implementing .NET Standard 2.0.
26+
### 6.x
27+
28+
`6.x` versions of the library require .NET 4.6.1 or a .NET Core version implementing .NET Standard 2.0.
29+
They also introduce potentially breaking public API changes covered in the [changelog](CHANGELOG.md).
3030

3131
### 5.x and 4.x
3232

@@ -37,18 +37,20 @@ For .NET Core users, 2.0 is the minimum supported version for `5.x` series.
3737

3838
`3.6.x` releases support Linux and MacOS on [Mono](https://www.mono-project.com/).
3939

40+
4041
## Change Log
4142

42-
See [/CHANGELOG.md](https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/master/CHANGELOG.md).
43+
See [CHANGELOG.md](CHANGELOG.md).
44+
4345

4446
## Building from Source
4547

46-
Please see [How to Run Tests](./RUNNING_TESTS.md) and [Building .NET Core](./BUILD_DOTNET_CORE.md)
47-
for build process overview.
48+
Please see [How to Run Tests](RUNNING_TESTS.md) for the build and test process overview.
49+
4850

4951
## Contributing
5052

51-
See [Contributing](./CONTRIBUTING.md) and [How to Run Tests](./RUNNING_TESTS.md).
53+
See [Contributing](CONTRIBUTING.md) and [How to Run Tests](RUNNING_TESTS.md).
5254

5355

5456
## License

RUNNING_TESTS.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
## Overview
22

3-
.NET client's test suite assumes there's a RabbitMQ node listening on localhost:5672
3+
.NET client's test suite assumes there's a RabbitMQ node listening on `localhost:5672`
44
(the default settings). SSL tests require a broker listening on the default
55
SSL port. Connection recovery tests assume `rabbitmqctl` at `../rabbitmq-server/scripts/rabbitmqctl`
66
can control the running node: this is the case when all repositories are cloned using
77
the [umbrella repository](https://github.com/rabbitmq/rabbitmq-public-umbrella).
88

9-
It is possible to use [Visual Studio 2015 Community Edition](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx),
10-
.NET Core, and `dotnet.exe` in `PATH`, to build the client and run the test suite.
9+
It is possible to use Visual Studio Community Edition .NET Core, and
10+
`dotnet.exe` in `PATH`, to build the client and run the test suite.
11+
1112

1213
## Building
1314

@@ -27,39 +28,47 @@ This will complete the code AMQP 0-9-1 protocol code generation and build all pr
2728

2829
## Running Tests
2930

30-
Tests can be run from Visual Studio using [NUnit Test Adapter](https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d).
31-
Note that it may take some time for the adapter to discover tests in the assemblies.
31+
Tests can be run from Visual Studio using the NUnit Test Adapter. Note that it
32+
may take some time for the adapter to discover tests in the assemblies.
3233

33-
The test suite assumes there's a RabbitMQ node running locally with all defaults, and the tests will need to be able to run commands against the [rabbitmqctl](https://www.rabbitmq.com/rabbitmqctl.8.html) tool for that node. Two options to accomplish this are:
34+
The test suite assumes there's a RabbitMQ node running locally with all
35+
defaults, and the tests will need to be able to run commands against the
36+
[`rabbitmqctl`](https://www.rabbitmq.com/rabbitmqctl.8.html) tool for that node.
37+
Two options to accomplish this are:
3438

3539
1. Team RabbitMQ uses [rabbitmq-public-umbrella](https://github.com/rabbitmq/rabbitmq-public-umbrella), which sets up a local RabbitMQ server [built from source](https://www.rabbitmq.com/build-server.html):
36-
```
40+
```
3741
git clone https://github.com/rabbitmq/rabbitmq-public-umbrella umbrella
3842
cd umbrella
3943
make co
4044
cd deps/rabbit
4145
make
4246
make run-broker
43-
```
47+
```
4448
4549
2. You can load a RabbitMQ node in a [docker](https://www.docker.com/) container. You will need to create an environment variable `RABBITMQ_RABBITMQCTL_PATH` and set it to `DOCKER:<container_name>` (for example `DOCKER:rabbitmq01`). This tells the unit tests to run the `rabbitmqctl` commands through docker, in the format `docker exec rabbitmq01 rabbitmqctl <args>`:
46-
```
50+
```
4751
docker run -d --hostname rabbitmq01 --name rabbitmq01 -p 15672:15672 -p 5672:5672 rabbitmq:3-management
48-
```
52+
```
4953
50-
Then, to run the tests on Windows use:
54+
Then, to run the tests on Windows use:
5155
56+
```
5257
run-test.bat
58+
```
5359
54-
On MacOS, Linux, BSD use:
60+
On MacOS, Linux, BSD use:
5561
62+
```
5663
run-test.sh
64+
```
5765
5866
Running individual tests and fixtures on Windows is trivial using the Visual Studio test runner.
5967
To run a specific tests fixture on MacOS or Linux, use the NUnit filter expressions to select the tests
6068
to be run:
6169
62-
dotnet test projects/Unit --filter "Name~TestAmqpUriParseFail"
63-
70+
```
71+
dotnet test projects/Unit --filter "Name~TestAmqpUriParseFail"
6472

65-
dotnet test projects/Unit --filter "FullyQualifiedName~RabbitMQ.Client.Unit.TestHeartbeats"
73+
dotnet test projects/Unit --filter "FullyQualifiedName~RabbitMQ.Client.Unit.TestHeartbeats"
74+
```

projects/RabbitMQ.Client/client/api/AsyncDefaultBasicConsumer.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,14 @@ public virtual Task HandleBasicConsumeOk(string consumerTag)
100100
}
101101

102102
/// <summary>
103-
/// Called each time a message arrives for this consumer.
103+
/// Called each time a message is delivered for this consumer.
104104
/// </summary>
105105
/// <remarks>
106-
/// Does nothing with the passed in information.
107-
/// Note that in particular, some delivered messages may require acknowledgement via <see cref="IModel.BasicAck"/>.
108-
/// The implementation of this method in this class does NOT acknowledge such messages.
106+
/// This is a no-op implementation. It will not acknowledge deliveries via <see cref="IModel.BasicAck"/>
107+
/// if consuming in automatic acknowledgement mode.
108+
/// Subclasses must copy or fully use delivery body before returning.
109+
/// Accessing the body at a later point is unsafe as its memory can
110+
/// be already released.
109111
/// </remarks>
110112
public virtual Task HandleBasicDeliver(string consumerTag,
111113
ulong deliveryTag,
@@ -120,10 +122,10 @@ public virtual Task HandleBasicDeliver(string consumerTag,
120122
}
121123

122124
/// <summary>
123-
/// Called when the model shuts down.
124-
/// </summary>
125-
/// <param name="model"> Common AMQP model.</param>
126-
/// <param name="reason"> Information about the reason why a particular model, session, or connection was destroyed.</param>
125+
/// Called when the model (channel) this consumer was registered on terminates.
126+
/// </summary>
127+
/// <param name="model">A channel this consumer was registered on.</param>
128+
/// <param name="reason">Shutdown context.</param>
127129
public virtual Task HandleModelShutdown(object model, ShutdownEventArgs reason)
128130
{
129131
ShutdownReason = reason;

projects/RabbitMQ.Client/client/api/DefaultBasicConsumer.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ public virtual void HandleBasicConsumeOk(string consumerTag)
147147
}
148148

149149
/// <summary>
150-
/// Called each time a message arrives for this consumer.
150+
/// Called each time a message is delivered for this consumer.
151151
/// </summary>
152152
/// <remarks>
153-
/// Does nothing with the passed in information.
154-
/// Note that in particular, some delivered messages may require acknowledgement via <see cref="IModel.BasicAck"/>.
155-
/// The implementation of this method in this class does NOT acknowledge such messages.
153+
/// This is a no-op implementation. It will not acknowledge deliveries via <see cref="IModel.BasicAck"/>
154+
/// if consuming in automatic acknowledgement mode.
155+
/// Subclasses must copy or fully use delivery body before returning.
156+
/// Accessing the body at a later point is unsafe as its memory can
157+
/// be already released.
156158
/// </remarks>
157159
public virtual void HandleBasicDeliver(string consumerTag,
158160
ulong deliveryTag,
@@ -166,10 +168,10 @@ public virtual void HandleBasicDeliver(string consumerTag,
166168
}
167169

168170
/// <summary>
169-
/// Called when the model shuts down.
170-
/// </summary>
171-
/// <param name="model"> Common AMQP model.</param>
172-
/// <param name="reason"> Information about the reason why a particular model, session, or connection was destroyed.</param>
171+
/// Called when the model (channel) this consumer was registered on terminates.
172+
/// </summary>
173+
/// <param name="model">A channel this consumer was registered on.</param>
174+
/// <param name="reason">Shutdown context.</param>
173175
public virtual void HandleModelShutdown(object model, ShutdownEventArgs reason)
174176
{
175177
ShutdownReason = reason;

projects/RabbitMQ.Client/client/events/AsyncEventingBasicConsumer.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,33 @@ public AsyncEventingBasicConsumer(IModel model) : base(model)
1111
{
1212
}
1313

14-
///<summary>Event fired on HandleBasicDeliver.</summary>
14+
///<summary>
15+
/// Event fired when a delivery arrives for the consumer.
16+
/// </summary>
17+
/// <remarks>
18+
/// Handlers must copy or fully use delivery body before returning.
19+
/// Accessing the body at a later point is unsafe as its memory can
20+
/// be already released.
21+
/// </remarks>
1522
public event AsyncEventHandler<BasicDeliverEventArgs> Received;
1623

17-
///<summary>Event fired on HandleBasicConsumeOk.</summary>
24+
///<summary>Fires when the server confirms successful consumer cancelation.</summary>
1825
public event AsyncEventHandler<ConsumerEventArgs> Registered;
1926

20-
///<summary>Event fired on HandleModelShutdown.</summary>
27+
///<summary>Fires on model (channel) shutdown, both client and server initiated.</summary>
2128
public event AsyncEventHandler<ShutdownEventArgs> Shutdown;
2229

23-
///<summary>Event fired on HandleBasicCancelOk.</summary>
30+
///<summary>Fires when the server confirms successful consumer cancelation.</summary>
2431
public event AsyncEventHandler<ConsumerEventArgs> Unregistered;
2532

26-
///<summary>Fires the Unregistered event.</summary>
33+
///<summary>Fires when the server confirms successful consumer cancelation.</summary>
2734
public override async Task HandleBasicCancelOk(string consumerTag)
2835
{
2936
await base.HandleBasicCancelOk(consumerTag).ConfigureAwait(false);
3037
await (Unregistered?.Invoke(this, new ConsumerEventArgs(new[] { consumerTag })) ?? Task.CompletedTask).ConfigureAwait(false);
3138
}
3239

33-
///<summary>Fires the Registered event.</summary>
40+
///<summary>Fires when the server confirms successful consumer registration.</summary>
3441
public override async Task HandleBasicConsumeOk(string consumerTag)
3542
{
3643
await base.HandleBasicConsumeOk(consumerTag).ConfigureAwait(false);

0 commit comments

Comments
 (0)