Mediarq.RabbitMQ 1.5.1

dotnet add package Mediarq.RabbitMQ --version 1.5.1
                    
NuGet\Install-Package Mediarq.RabbitMQ -Version 1.5.1
                    
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="Mediarq.RabbitMQ" Version="1.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mediarq.RabbitMQ" Version="1.5.1" />
                    
Directory.Packages.props
<PackageReference Include="Mediarq.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 Mediarq.RabbitMQ --version 1.5.1
                    
#r "nuget: Mediarq.RabbitMQ, 1.5.1"
                    
#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 Mediarq.RabbitMQ@1.5.1
                    
#: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=Mediarq.RabbitMQ&version=1.5.1
                    
Install as a Cake Addin
#tool nuget:?package=Mediarq.RabbitMQ&version=1.5.1
                    
Install as a Cake Tool

Mediarq.RabbitMQ

A lightweight, direct RabbitMQ bridge for Mediarq notifications: publish a notification onto an exchange when it is published through Mediarq, and receive it back into the real Mediarq pipeline via a background consumer — no Mediarq.MassTransit dependency required for the simple pub/sub case.

dotnet add package Mediarq.RabbitMQ

Marking an event

public sealed record OrderPlaced(Guid OrderId, string Customer) : IRabbitMqEvent
{
    public static string Exchange => "orders";
    public static string Queue => "orders.order-placed";
    public static string RoutingKey => "order-placed";
}

Exchange/Queue/RoutingKey are static abstract members, not instance properties: the subscribe side needs this routing information at startup, before any OrderPlaced instance exists, and both directions reading the same static members means the publish routing and the subscribe routing can never drift apart (same rationale as Mediarq.Dapr's IDaprPubSubEvent).

Bring your own connection

This package never owns the connection's lifecycle — register an IConnection yourself:

builder.Services.AddSingleton<IConnection>(_ =>
{
    var factory = new ConnectionFactory { Uri = new Uri("amqp://guest:guest@localhost:5672") };
    return factory.CreateConnectionAsync().GetAwaiter().GetResult();
});

Publishing (outbound)

builder.Services.AddMediarqRabbitMqPublisher<OrderPlaced>();

Every IPublisher.Publish(new OrderPlaced(...)) call now also JSON-serializes OrderPlaced and publishes it to the orders exchange under the order-placed routing key — on a short-lived channel created per publish — in addition to running any in-process handlers.

Subscribing (inbound)

builder.Services.AddMediarqRabbitMqSubscriber<OrderPlaced>();

Declares the exchange/queue/binding, consumes with manual acknowledgement, deserializes each delivery and republishes it through IPublisher — the same pipeline as any in-process Publish call (validation, other behaviors, every registered handler). A processing failure (bad JSON, a throwing handler) is logged and the delivery is negatively acknowledged without requeue, so a poison message doesn't loop forever; route it to a dead-letter exchange at the queue-argument level at the broker if you need one.

Duplicate delivery

RabbitMQ is at-least-once: a connection drop between processing a message and its ack landing can cause a redelivery. This package does not implement deduplication — if your handlers aren't naturally idempotent, dedupe on a message id yourself (a first-class inbox built on Mediarq.Idempotency is a natural follow-up, not bundled here).

Learn more

Wiring extensions · Full README

MIT © Nicolas Rouffart

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
1.5.1 123 7/26/2026
1.5.0 116 7/26/2026