ModulusKit.Messaging.AzureServiceBus 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ModulusKit.Messaging.AzureServiceBus --version 3.0.0
                    
NuGet\Install-Package ModulusKit.Messaging.AzureServiceBus -Version 3.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="ModulusKit.Messaging.AzureServiceBus" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ModulusKit.Messaging.AzureServiceBus" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ModulusKit.Messaging.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 ModulusKit.Messaging.AzureServiceBus --version 3.0.0
                    
#r "nuget: ModulusKit.Messaging.AzureServiceBus, 3.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 ModulusKit.Messaging.AzureServiceBus@3.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=ModulusKit.Messaging.AzureServiceBus&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ModulusKit.Messaging.AzureServiceBus&version=3.0.0
                    
Install as a Cake Tool

ModulusKit.Messaging.AzureServiceBus

Azure Service Bus transport for ModulusKit.Messaging, built directly on the MIT-licensed Azure.Messaging.ServiceBus SDK — no MassTransit dependency.

Requires Standard or Premium tier. The topology uses topics, which the Basic tier does not support.

Usage

builder.Services.AddModulusMessaging(builder.Configuration, options =>
{
    options.Assemblies.Add(typeof(Program).Assembly);
    // For managed identity instead of a connection string:
    // options.Credential = new DefaultAzureCredential();
});
builder.Services.AddModulusAzureServiceBusTransport();
{
  "Messaging": {
    "Transport": "AzureServiceBus",
    "FullyQualifiedNamespace": "myns.servicebus.windows.net",
    "EndpointName": "my-service"
  }
}

Topology

Entity Name Purpose
Topic <event type full name, lower-cased> One per event type; publish target
Subscription <EndpointName> (50-char cap with stable hash suffix) One per endpoint; replicas compete
Dead-letter built-in subscription DLQ Messages that exhausted ConsumerRetry (reason RetriesExhausted)

Lock auto-renewal scales with your retry configuration: the processor's MaxAutoLockRenewalDuration is computed from the worst-case sum of ConsumerRetry delays plus a safety margin, so long retry budgets no longer lose the message lock mid-dispatch. Prefetch is disabled (PrefetchCount = 0) so buffered messages cannot expire their locks before processing starts. AutoProvision (default true) creates topics/subscriptions at startup and requires Manage rights; pre-create entities and set it to false for least-privilege deployments.

Testing

AzureServiceBusTopology (naming) and AzureServiceBusEnvelopeMapper (envelope/property mapping) are pure and unit-tested in Modulus.Messaging.Tests/AzureServiceBus. tests/Modulus.Messaging.AzureServiceBus.IntegrationTests runs the transport against the official mcr.microsoft.com/azure-messaging/servicebus-emulator (with its required mssql/server companion, both managed by the Testcontainers.ServiceBus module), covering publish/consume roundtrip and dead-lettering after retry exhaustion (asserted via a ServiceBusReceiver on the subscription's DLQ SubQueue).

The emulator does not support ServiceBusAdministrationClient, so every scenario runs with MessagingOptions.AutoProvision = false against topology pre-declared in the project's checked-in Config.json. A same-project, non-Category=Integration [Fact] (ConfigJsonDriftGuardTests) asserts the topic/subscription names in Config.json exactly match what AzureServiceBusTopology.TopicName/SubscriptionName compute for the fixture event types and endpoint names the Integration tests use, so a rename or a topology-naming change fails fast without needing Docker.

License

MIT — part of the Modulus project.

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
4.0.0 102 7/26/2026
3.1.0 294 7/26/2026
3.0.0 231 7/26/2026
2.1.0 108 7/4/2026
2.0.0 106 7/3/2026