Soenneker.ServiceBus.Transmitter 4.0.3871

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.ServiceBus.Transmitter

Builds and sends Soenneker message envelopes to Azure Service Bus, either immediately or through a bounded in-process background queue.

Installation

dotnet add package Soenneker.ServiceBus.Transmitter

Configuration

{
  "Azure": {
    "ServiceBus": {
      "ConnectionString": "Endpoint=sb://...",
      "Enable": true,
      "Log": false,
      "TransmitterLogging": false
    }
  },
  "Background": {
    "QueueLength": 5000,
    "Log": false
  }
}

Azure:ServiceBus:Enable is required. When false, send calls log a warning and return without contacting Service Bus. The connection-string credential needs queue-management and send permissions because the sender stack creates missing queues with Azure defaults.

Azure:ServiceBus:Log enables payload logging in the message builder and changes its JSON option to pretty output. TransmitterLogging writes complete serialized payloads at information level. Keep both disabled for sensitive messages unless the log destination is explicitly approved for that data.

Registration

using Soenneker.ServiceBus.Transmitter.Registrars;

services.AddServiceBusTransmitterAsSingleton();

This also registers the singleton background queue, message builder, sender cache, queue utility, administration client, and top-level Service Bus client.

AddServiceBusTransmitterAsScoped() makes only IServiceBusTransmitter scoped; its background queue and Service Bus dependencies remain singleton.

Send one message

Messages must derive from Soenneker.Messages.Base.Message and supply Type, Id, Queue, Sender, and CreatedAt:

OrderCreated message = new()
{
    Type = "order.created.v1",
    Id = Guid.NewGuid().ToString("N"),
    Queue = "orders",
    Sender = "checkout-api",
    CreatedAt = DateTimeOffset.UtcNow,
    OrderId = orderId
};

await transmitter.SendMessage(
    message,
    useQueue: false,
    cancellationToken);

With useQueue: false, the call attempts the send before returning. Send and cancellation exceptions are caught and logged by the transmitter rather than returned to the caller, so successful completion is not a delivery receipt. Message-build failures and oversized bodies are also logged and skipped.

With useQueue: true (the default), the message is serialized on the caller's path and the materialized work item is added to the bounded background queue:

await transmitter.SendMessage(message, cancellationToken: cancellationToken);

That call completes when the queue accepts the work item, not when Azure Service Bus accepts the message. The queue exists only in process and is not an outbox. Process failure or shutdown can lose queued work; use foreground sending or a durable outbox when loss is unacceptable.

Send a batch

await transmitter.SendMessages(
    messages,
    useQueue: false,
    cancellationToken);

Every item must target the same Message.Queue; otherwise the entire call is logged and skipped. The transmitter builds Azure batches and sends each full batch before continuing. A message that cannot be built is skipped. If a message cannot fit into a fresh batch, the remaining messages fall back to individual sends.

Batch sends are not atomic. Earlier batches may already have reached Service Bus when a later operation fails, and retries can create duplicates. Use stable identifiers and idempotent consumers.

The message builder places Message.Type in ApplicationProperties["type"], but it does not copy Message.Id into the broker MessageId. Set transport-level deduplication metadata separately if your contract requires it.

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 (3)

Showing the top 3 NuGet packages that depend on Soenneker.ServiceBus.Transmitter:

Package Downloads
Soenneker.ServiceBus.Suite

Convenience references and dependency injection registration for the Soenneker Service Bus transmitter stack.

Soenneker.MsTeams.Util

A centralized utility for sending rich, configurable Adaptive Card messages to Microsoft Teams channels via a service bus, with environment-aware filtering and dynamic content generation.

Soenneker.Email.Util

A utility to place emails on Service Bus

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.3882 75 9/1/2026
4.0.3881 57 9/1/2026
4.0.3880 87 9/1/2026
4.0.3879 41 9/1/2026
4.0.3878 59 9/1/2026
4.0.3877 158 8/31/2026
4.0.3876 57 8/31/2026
4.0.3875 116 8/31/2026
4.0.3873 134 8/31/2026
4.0.3872 147 8/31/2026
4.0.3871 122 8/31/2026
4.0.3870 115 8/31/2026
4.0.3868 157 8/30/2026
4.0.3867 97 8/30/2026
4.0.3866 183 8/30/2026
4.0.3864 88 8/30/2026
4.0.3863 238 8/30/2026
4.0.3862 86 8/30/2026
4.0.3860 89 8/30/2026
4.0.3858 76 8/29/2026
Loading failed

Update dependency Soenneker.ServiceBus.Message to 4.0.3081 (#4776)