ModulusKit.Messaging.AzureServiceBus
3.1.0
See the version list below for details.
dotnet add package ModulusKit.Messaging.AzureServiceBus --version 3.1.0
NuGet\Install-Package ModulusKit.Messaging.AzureServiceBus -Version 3.1.0
<PackageReference Include="ModulusKit.Messaging.AzureServiceBus" Version="3.1.0" />
<PackageVersion Include="ModulusKit.Messaging.AzureServiceBus" Version="3.1.0" />
<PackageReference Include="ModulusKit.Messaging.AzureServiceBus" />
paket add ModulusKit.Messaging.AzureServiceBus --version 3.1.0
#r "nuget: ModulusKit.Messaging.AzureServiceBus, 3.1.0"
#:package ModulusKit.Messaging.AzureServiceBus@3.1.0
#addin nuget:?package=ModulusKit.Messaging.AzureServiceBus&version=3.1.0
#tool nuget:?package=ModulusKit.Messaging.AzureServiceBus&version=3.1.0
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 | Versions 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. |
-
net10.0
- Azure.Core (>= 1.47.1)
- Azure.Messaging.ServiceBus (>= 7.20.1)
- Microsoft.EntityFrameworkCore (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.3)
- Microsoft.Extensions.Configuration (>= 10.0.3)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.3)
- Microsoft.Extensions.DependencyInjection (>= 10.0.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Diagnostics.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.3)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Logging (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- ModulusKit.Messaging (>= 3.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.