Soenneker.ServiceBus.Queue 11.0.2475

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

Azure Service Bus helpers for creating a queue when absent and destructively removing its currently available active messages.

Installation

dotnet add package Soenneker.ServiceBus.Queue

Configuration and registration

Set Azure:ServiceBus:ConnectionString, then register the utility:

using Soenneker.ServiceBus.Queue.Registrars;

services.AddServiceBusQueueUtilAsScoped();

The scoped registrar deliberately keeps the underlying administration and data-plane client utilities singleton while making IServiceBusQueueUtil scoped. AddServiceBusQueueUtilAsSingleton() is also available.

The connection-string credential needs management permission to create queues and receive permission to empty them.

Ensure a queue exists

await queueUtil.CreateQueueIfDoesNotExist(
    "orders",
    cancellationToken);

The queue is created with Azure SDK defaults. This method does not update an existing queue or configure settings such as lock duration, duplicate detection, partitioning, maximum delivery count, or dead lettering. Use ServiceBusAdministrationClient directly when custom entity options are required.

The existence check and creation are separate broker operations. Concurrent callers can race; coordinate provisioning when more than one instance may create the same entity.

Empty a queue

await queueUtil.EmptyQueue("orders", cancellationToken);

EmptyQueue is destructive. It receives batches of up to 100 messages in ReceiveAndDelete mode and stops after a one-second receive returns no messages. Received messages cannot be recovered or abandoned.

This operation drains currently available active messages from the queue's primary entity. It does not purge the dead-letter subqueue, explicitly receive deferred messages, cancel scheduled messages, or prevent producers from adding messages concurrently. A producer can enqueue a message after the final empty receive.

Do not use EmptyQueue as part of normal message processing. It is intended for controlled cleanup where permanent deletion is acceptable.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.ServiceBus.Queue:

Package Downloads
Soenneker.ServiceBus.Sender

A utility library that holds Azure Service senders

Soenneker.ServiceBus.Receptor

An abstract Service Bus class meant to be derived by specific bus receptors

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.2475 345 11/12/2026
11.0.2474 164 11/12/2026
11.0.2473 179 11/11/2026
11.0.2472 242 11/11/2026
11.0.2471 162 11/11/2026
11.0.2470 129 11/11/2026
11.0.2468 126 11/11/2026
11.0.2467 58 11/11/2026
11.0.2466 271 11/10/2026
11.0.2465 56 11/10/2026
11.0.2464 1,427 11/3/2026
11.0.2463 245 11/3/2026
11.0.2462 1,063 10/27/2026
11.0.2461 146 10/27/2026
11.0.2460 521 10/26/2026
11.0.2458 249 10/26/2026
11.0.2456 187 10/26/2026
11.0.2455 149 10/26/2026
11.0.2454 247 10/26/2026
11.0.2453 97 10/26/2026
Loading failed

Update dependency Soenneker.ServiceBus.Client to 11.0.1726 (#3265)