Mediarq.AzureServiceBus 1.5.1

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

Mediarq.AzureServiceBus

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

dotnet add package Mediarq.AzureServiceBus

Marking an event

public sealed record OrderPlaced(Guid OrderId, string Customer) : IAzureServiceBusEvent
{
    public static string TopicName => "orders";
    public static string SubscriptionName => "order-placed-subscribers";
}

TopicName/SubscriptionName 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 topic and the subscribe topic/subscription can never drift apart (same rationale as Mediarq.Dapr's IDaprPubSubEvent and Mediarq.RabbitMQ's IRabbitMqEvent).

This package does not provision the topic/subscription — create them ahead of time (portal, ARM/Bicep, or ServiceBusAdministrationClient), the same way you would for any Service Bus application.

Bring your own client

This package never owns the client's lifecycle — register a ServiceBusClient yourself:

builder.Services.AddSingleton(_ => new ServiceBusClient(connectionString));
// or, with Microsoft Entra ID: new ServiceBusClient(fullyQualifiedNamespace, new DefaultAzureCredential())

Publishing (outbound)

builder.Services.AddMediarqAzureServiceBusPublisher<OrderPlaced>();

Every IPublisher.Publish(new OrderPlaced(...)) call now also JSON-serializes OrderPlaced and sends it to the orders topic — on a sender created per publish — in addition to running any in-process handlers.

Subscribing (inbound)

builder.Services.AddMediarqAzureServiceBusSubscriber<OrderPlaced>();

Processes the order-placed-subscribers subscription on the orders topic, deserializes each message 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 message is moved straight to the dead-letter subqueue — the Service Bus analogue of "nack without requeue" — so a poison message doesn't loop forever.

Duplicate delivery

Service Bus's default (non-session, PeekLock) mode is at-least-once: a lock expiring before completion lands can cause a redelivery. This package does not implement deduplication — enable the entity's built-in duplicate detection window if you need broker-side dedup, or dedupe on a message id yourself if your handlers aren't naturally idempotent.

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 137 7/26/2026
1.5.0 118 7/26/2026