Skip to content

Commit 980f977

Browse files
committed
* Add to v7 migration guide
1 parent f58643f commit 980f977

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

v7-MIGRATION.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Migrating to RabbitMQ .NET Client 7.x
22

3+
This document makes note of major changes in the API of this library for
4+
version 7. In addition to this document, please refer to the comprehensive
5+
integration test suites
6+
[here](https://github.com/rabbitmq/rabbitmq-dotnet-client/tree/main/projects/Test/Integration)
7+
and
8+
[here](https://github.com/rabbitmq/rabbitmq-dotnet-client/tree/main/projects/Test/SequentialIntegration)
9+
that demonstrate these changes.
10+
11+
If you have questions about version 7 of this library, please start a new discussion here:
12+
13+
https://github.com/rabbitmq/rabbitmq-dotnet-client/discussions
14+
315
## `async` / `await`
416

517
The entire public API and internals of this library have been modified to use
@@ -11,3 +23,18 @@ All TAP methods end with an `Async` suffix, and can be `await`-ed.
1123

1224
* `IModel` has been renamed to `IChannel`
1325

26+
## Consuming messages
27+
28+
When a message is delivered to your code via the
29+
`AsyncEventingBasicConsumer.Received` event or by sub-classing
30+
`DefaultAsyncConsumer`, please note that the `ReadOnlyMemory<byte>` that
31+
represents the message body is owned by this library, and that memory is only
32+
valid for application use within the context of the executing `Received` event
33+
or `HandleBasicDeliver` method.
34+
35+
If you wish to use this data _outside_ of these methods, you **MUST** copy the
36+
data for your use:
37+
38+
```
39+
byte[] myMessageBody = eventArgs.Body.ToArray();
40+
```

0 commit comments

Comments
 (0)