File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 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
517The 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+ ```
You can’t perform that action at this time.
0 commit comments