Runax.Messaging.Transports.RabbitMq 2.0.0

dotnet add package Runax.Messaging.Transports.RabbitMq --version 2.0.0
                    
NuGet\Install-Package Runax.Messaging.Transports.RabbitMq -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Runax.Messaging.Transports.RabbitMq" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Runax.Messaging.Transports.RabbitMq" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Runax.Messaging.Transports.RabbitMq" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Runax.Messaging.Transports.RabbitMq --version 2.0.0
                    
#r "nuget: Runax.Messaging.Transports.RabbitMq, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Runax.Messaging.Transports.RabbitMq@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Runax.Messaging.Transports.RabbitMq&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Runax.Messaging.Transports.RabbitMq&version=2.0.0
                    
Install as a Cake Tool

Runax.Messaging.Transports.RabbitMq

RabbitMQ transport for Runax.Messaging. Topics map to routing keys on a topic exchange.

Built against RabbitMQ.Client 7.x (the asynchronous IChannel API).

Install

dotnet add package Runax.Messaging
dotnet add package Runax.Messaging.Transports.RabbitMq

Register

Attach the transport to a bus with its config object:

using Runax.Messaging;
using Runax.Messaging.Transports.RabbitMq;

builder.Services.AddRunaxMessaging(messaging =>
{
    messaging.AddBus(bus =>
    {
        bus.AddTransport(new RabbitMqConfig
        {
            HostName = "localhost",
        });
        bus.AddConsumer<OrderPlacedConsumer>();
    });
});

RabbitMqConfig lives in the Runax.Messaging.Transports.RabbitMq namespace, so add that using. The config is validated at startup (DataAnnotations, when the AddBus block completes); bind it from an IConfiguration section instead of setting properties: bus.AddTransport<RabbitMqConfig>(builder.Configuration.GetSection("RabbitMq")).

Config

Set these directly on RabbitMqConfig.

Property Meaning Default Required?
HostName RabbitMQ host. Ignored when Uri is set. localhost No
Port RabbitMQ port. Ignored when Uri is set. 5672 No
UserName Username. Ignored when Uri is set. guest No
Password Password. Prefer Uri (an amqps:// string) or a secret store. Ignored when Uri is set. guest No
VirtualHost Virtual host. Ignored when Uri is set. / No
Uri Full AMQP connection URI (e.g. amqps://user:pass@host:5671/vhost). Takes precedence over the discrete settings and enables TLS for the amqps scheme. null No
UseTls Enable TLS when connecting via the discrete host settings (not Uri). false No
SslServerName TLS server name (SNI) when UseTls is on. Defaults to HostName. null No
ExchangeName Exchange to publish to and bind against. runax.messaging No
ExchangeType Exchange type. topic No
PrefetchCount Unacknowledged messages allowed in flight per consumer (BasicQos). 10 No
PublisherConfirms Wait for broker acknowledgement of each publish. true No
ConfirmTimeout How long to wait for a publisher confirm before failing. 5s No
PublishChannelPoolSize Size of the publish channel pool; larger allows more concurrent publishes. 5 No
DeadLetterExchange Dead-letter exchange for broker-native dead-lettering. When set, consumer queues are declared with x-dead-letter-exchange. null No
DeadLetterExchangeType Type of the declared DeadLetterExchange. topic No
RegisterHealthCheck Auto-register the runax:{bus} health check (inherited from TransportConfig). true No

Beyond the transport config, settings from the core package apply to the bus that runs this transport — AddConsumer<T>(), WithRetry(...), OnUnroutableMessage(...), ConfigureSerialization(...), and UseSerializer<T>() — all inside the same AddBus block. Two RabbitMQ clusters are simply two buses, each with its own RabbitMqConfig. See Configuration & per-bus settings.

Behavior

  • Publish sends the serialized envelope to ExchangeName using the topic as the routing key, with persistent delivery. Publishes fan out across a pool of channels (PublishChannelPoolSize) and, when PublisherConfirms is on, wait for broker confirmation. Automatic and topology recovery are enabled. A ConsumeOnly bus creates no publish channel pool.
  • Batch publish (PublishBatchAsync) publishes all envelopes on one channel and waits for a single confirm for the whole batch instead of one per message.
  • Subscribe declares an exclusive, auto-delete queue (with BasicQos prefetch), binds it to each topic, and maps the dispatch verdict to the broker:
    • Acknowledge → basic.ack
    • Requeue → basic.nack with requeue
    • DeadLetter → basic.nack without requeue, routed to DeadLetterExchange when configured (otherwise dropped by the broker)

To use RabbitMQ's native dead-lettering, set DeadLetterExchange and configure bus.WithRetry(o => o.Strategy = DeadLetterStrategy.BrokerNative) on the bus.

Health check

A broker-reachability check named runax:{bus} is registered automatically for each bus that runs this transport. Opt out per bus:

bus.AddTransport(new RabbitMqConfig { HostName = "localhost", RegisterHealthCheck = false });

Telemetry

The transport reports messaging.system = "rabbitmq" on the spans and metrics emitted by the core package (activity source / meter "Runax.Messaging"); the messaging.runax.bus tag identifies the bus.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 100 9/10/2026
1.0.0 118 7/26/2026