Skip to content

RabbitMQ.Client v7

ServiceBus.Core.Rabbit.V7 targets RabbitMQ.Client v7.

The main RabbitMQ channel abstraction is:

IChannel

Package

dotnet add package ServiceBus.Core.Rabbit.V7

Channel Creation

var channel = await connection.CreateChannelAsync();

IChannel is passed to bound clients such as publishers and subscribers.

graph LR
    IConnection --> IChannel
    IChannel --> Publisher
    IChannel --> Subscriber

Publisher Construction

var publisher = new PublisherBound(
    descriptor,
    formatter,
    channel);

Subscriber Construction

var subscriber = new SubscriberBound<OrderCreated>(
    descriptor,
    formatter,
    channel);

Descriptor Compatibility

Descriptors remain conceptually the same between v6 and v7.

The most important difference is the RabbitMQ channel abstraction:

Provider Channel
ServiceBus.Core.Rabbit IModel
ServiceBus.Core.Rabbit.V7 IChannel

When To Use

Use the v7 provider when:

  • your application targets RabbitMQ.Client v7;
  • you are modernizing RabbitMQ dependencies;
  • you want to align with the newer RabbitMQ.Client API surface.