Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.68 KB

v7-MIGRATION.md

File metadata and controls

46 lines (33 loc) · 1.68 KB

Migrating to RabbitMQ .NET Client 7.x

This document makes note of major changes in the API of this library for version 7. In addition to this document, please refer to the comprehensive integration test suites here and here that demonstrate these changes.

If you have questions about version 7 of this library, please start a new discussion here:

https://github.com/rabbitmq/rabbitmq-dotnet-client/discussions

async / await

The entire public API and internals of this library have been modified to use the Task asynchronous programming model (TAP). All TAP methods end with an Async suffix, and can be await-ed.

Connections and channels

  • IModel has been renamed to IChannel

Publishing messages

Just create a new instance of the BasicProperties class when publishing messages. The CreateBasicProperties method on the old IModel interface has been removed.

Consuming messages

When a message is delivered to your code via the AsyncEventingBasicConsumer.Received event or by sub-classing DefaultAsyncConsumer, please note that the ReadOnlyMemory<byte> that represents the message body is owned by this library, and that memory is only valid for application use within the context of the executing Received event or HandleBasicDeliver method.

If you wish to use this data outside of these methods, you MUST copy the data for your use:

byte[] myMessageBody = eventArgs.Body.ToArray();