NexJob.Trigger.AzureServiceBus
5.10.0
dotnet add package NexJob.Trigger.AzureServiceBus --version 5.10.0
NuGet\Install-Package NexJob.Trigger.AzureServiceBus -Version 5.10.0
<PackageReference Include="NexJob.Trigger.AzureServiceBus" Version="5.10.0" />
<PackageVersion Include="NexJob.Trigger.AzureServiceBus" Version="5.10.0" />
<PackageReference Include="NexJob.Trigger.AzureServiceBus" />
paket add NexJob.Trigger.AzureServiceBus --version 5.10.0
#r "nuget: NexJob.Trigger.AzureServiceBus, 5.10.0"
#:package NexJob.Trigger.AzureServiceBus@5.10.0
#addin nuget:?package=NexJob.Trigger.AzureServiceBus&version=5.10.0
#tool nuget:?package=NexJob.Trigger.AzureServiceBus&version=5.10.0
NexJob.Trigger.AzureServiceBus
Azure Service Bus trigger for NexJob. Receives messages from an ASB queue or topic and automatically enqueues them as NexJob jobs.
Installation
dotnet add package NexJob.Trigger.AzureServiceBus
Usage
Queue Setup
using NexJob.Trigger.AzureServiceBus;
builder.Services.AddNexJobAzureServiceBusTrigger(options =>
{
options.ConnectionString = "Endpoint=sb://...";
options.QueueOrTopicName = "my-queue";
});
Topic and Subscription Setup
builder.Services.AddNexJobAzureServiceBusTrigger(options =>
{
options.ConnectionString = "Endpoint=sb://...";
options.QueueOrTopicName = "my-topic";
options.SubscriptionName = "my-sub";
options.MaxConcurrentMessages = 5;
});
Strongly-Typed Consumer Registration
builder.Services.AddNexJobAzureServiceBusTrigger<ProcessOrderAsbJob>(options =>
{
options.ConnectionString = "Endpoint=sb://...";
options.QueueOrTopicName = "my-queue";
});
Operational Visibility
This trigger registers with IListenerRegistry to report live connection states (Starting, Listening, Reconnecting, Stopped) directly to the Dashboard /listeners page and the Cluster Pipeline Topology Map.
Configuration Options
| Option | Description | Default |
|---|---|---|
ConnectionString |
Azure Service Bus connection string (required) | - |
QueueOrTopicName |
Name of the queue or topic (required) | - |
SubscriptionName |
Subscription name (required for topics) | null |
MaxConcurrentMessages |
Max concurrent messages | 1 |
TargetQueue |
NexJob target queue name | "default" |
JobPriority |
Job execution priority | Normal |
Message Contract
The trigger reads the following from each message:
- Body: The job input as a UTF-8 string (JSON).
- ApplicationProperties:
nexjob.job_type: Assembly-qualified name of the job type. Optional when the subscriber setsoptions.JobTypeor registers the trigger withAddNexJobAzureServiceBusTrigger<TJob>(); the header wins when both are present. A message with neither can never become a job and is dead-lettered.traceparent: W3C traceparent for distributed tracing (optional).
The job idempotency key is the message's MessageId. A transient enqueue failure (storage or network error) abandons the message so Service Bus delivers it again (MaxDeliveryCount decides when it is dead-lettered).
Broker Guarantees
This trigger satisfies all 5 NexJob trigger guarantees adapted for Service Bus:
- At-least-once delivery — messages are never lost before enqueue. Uses PeekLock mode.
- Lock renewal — messages stay locked while processing. The SDK handles lock renewal automatically.
- Explicit ack — messages completed (
CompleteMessageAsync) only afterEnqueueAsyncsucceeds. - Dead-letter on failure — a transient enqueue failure abandons the message (
AbandonMessageAsync) so it is delivered again and Service Bus routes it to the DLQ after the max delivery count; a message that can never be enqueued (no job type, malformed) is dead-lettered immediately. - Graceful shutdown —
CancellationTokenrespected, processor stops accepting new messages and waits for in-flight ones.
Trace Propagation
The trigger extracts W3C traceparent from ApplicationProperties and propagates it to the JobRecord.
var message = new ServiceBusMessage(payload);
message.ApplicationProperties["nexjob.job_type"] = typeof(MyJob).AssemblyQualifiedName;
message.ApplicationProperties["traceparent"] = Activity.Current?.Id;
await sender.SendMessageAsync(message);
Known Limitations
- Fixed input type: The
inputTypeis fixed tostringbecause broker triggers receive the message body as text (JSON, XML or plain text). The body is delivered to the job verbatim; deserializing it to a concrete type is the responsibility of the job handler.
| Product | Versions 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 was computed. 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 was computed. 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. |
-
net8.0
- Azure.Messaging.ServiceBus (>= 7.18.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.DataAnnotations (>= 8.0.0)
- NexJob (>= 5.10.0)
- System.Text.Json (>= 8.0.5)
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 |
|---|---|---|
| 5.10.0 | 0 | 10/8/2026 |
| 5.9.0 | 51 | 10/5/2026 |
| 5.8.0 | 91 | 10/4/2026 |
| 5.7.0 | 81 | 10/1/2026 |
| 5.6.2 | 82 | 10/1/2026 |
| 5.6.1 | 85 | 9/30/2026 |
| 5.6.0 | 81 | 9/30/2026 |
| 5.5.0 | 80 | 9/25/2026 |
| 5.4.1 | 81 | 9/24/2026 |
| 5.4.0 | 89 | 9/24/2026 |
| 5.3.0 | 95 | 9/21/2026 |
| 5.2.0 | 97 | 9/20/2026 |
| 5.1.0 | 94 | 9/17/2026 |
| 5.0.0 | 104 | 9/17/2026 |
| 4.0.1 | 93 | 9/17/2026 |
| 4.0.0 | 150 | 4/21/2026 |
| 3.0.0 | 131 | 4/16/2026 |
| 0.0.0-alpha.0 | 53 | 9/17/2026 |