Sidio.Functions.Worker.ServiceBus
1.2.6
Prefix Reserved
See the version list below for details.
dotnet add package Sidio.Functions.Worker.ServiceBus --version 1.2.6
NuGet\Install-Package Sidio.Functions.Worker.ServiceBus -Version 1.2.6
<PackageReference Include="Sidio.Functions.Worker.ServiceBus" Version="1.2.6" />
<PackageVersion Include="Sidio.Functions.Worker.ServiceBus" Version="1.2.6" />
<PackageReference Include="Sidio.Functions.Worker.ServiceBus" />
paket add Sidio.Functions.Worker.ServiceBus --version 1.2.6
#r "nuget: Sidio.Functions.Worker.ServiceBus, 1.2.6"
#:package Sidio.Functions.Worker.ServiceBus@1.2.6
#addin nuget:?package=Sidio.Functions.Worker.ServiceBus&version=1.2.6
#tool nuget:?package=Sidio.Functions.Worker.ServiceBus&version=1.2.6
Sidio.Functions.Worker.ServiceBus
A collection of useful service bus features for .NET isolated middleware.
Installation
Add the NuGet package to your project.
Middleware
Middleware template
The abstract class ServiceBusMiddlewareBase supports the following methods:
BeforeInvocationAsync: executed before the invocation of theFunctionExecutionDelegate.AfterInvocationAsync: executed after the invocation of theFunctionExecutionDelegate, unless an exception is thrown.AlwaysAfterInvocation: executed after the invocation of theFunctionExecutionDelegate, regardless of an exception being thrown.OnExceptionAsync: executed when an exception is thrown during the invocation of theFunctionExecutionDelegate. Returntruewhen the exception is handled,falsewhen the exception should be rethrown.
ExceptionInsightMiddleware
The ExceptionInsightMiddleware adds exception details to a dead-lettered message:
- Dead letter reason
- Exception message
Please note: it is currently not possible to read the maximum delivery count setting of a queue or topic. Therefore, you have to configure the ExceptionInsightMiddlewareOptions manually
and ensure the maximum delivery count is set to a value equal or less than the service bus setting.
Usage
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults(
workerApplication =>
{
workerApplication.UseExceptionInsightMiddleware();
})
// ...
ScheduledRetryMiddleware
Usage
The ScheduledRetryMiddleware is an extension of the ExceptionInsightMiddleware, you should not register both middleware.
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults(
workerApplication =>
{
workerApplication.UseScheduledRetryMiddleware();
})
// ...
Configuration
- MaxDeliveryCount: the maximum number of delivery attempts before a message is dead-lettered.
- BackoffMode: the backoff mode to use for rescheduling messages.
- BackoffInSeconds: the number of seconds to wait before rescheduling a message.
Service Bus client provider
It's possible to use a custom IServiceBusClientProvider to provide a ServiceBusClient for sending messages:
services.AddScoped<IServiceBusClientProvider, MyServiceBusClientProvider>();
Manual dead-letter resubmission
When you want to resubmit a dead-lettered message manually, make sure the ScheduledRetryMiddleware.DeliveryAttempts property is removed.
Extensions
FunctionContext extensions
GetServiceBusTrigger
Gets the ServiceBusTriggerAttribute from the function context:
var attribute = functionContext.GetServiceBusTrigger();
IsServiceBusTrigger
Determines whether the function is a service bus trigger. Can be used when registering middleware:
functionsWorkerApplicationBuilder.UseWhen<MySerivceBusMiddleware>(context => context.IsServiceBusTrigger());
Known issues
- The
ExceptionInsightMiddlewareandScheduledRetryMiddlewareonly support a trigger with aServiceBusRecievedMessagebinding. A trigger-binding to astringis not supported.
| 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 is compatible. 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
- Microsoft.Azure.Functions.Worker.Core (>= 2.2.0)
- Microsoft.Azure.Functions.Worker.Extensions.ServiceBus (>= 5.24.0)
-
net9.0
- Microsoft.Azure.Functions.Worker.Core (>= 2.2.0)
- Microsoft.Azure.Functions.Worker.Extensions.ServiceBus (>= 5.24.0)
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 | |
|---|---|---|---|
| 1.3.0 | 292 | 11/12/2025 | |
| 1.2.6 | 115 | 10/25/2025 | |
| 1.2.5 | 255 | 5/26/2025 | |
| 1.2.4 | 264 | 5/12/2025 | |
| 1.2.3 | 223 | 3/31/2025 | |
| 1.2.2 | 209 | 3/3/2025 | |
| 1.2.1 | 170 | 2/3/2025 | |
| 1.2.0 | 222 | 11/13/2024 | |
| 1.1.6 | 253 | 10/14/2024 | |
| 1.1.5 | 245 | 9/30/2024 | |
| 1.1.4 | 307 | 8/12/2024 | |
| 1.1.3 | 254 | 8/9/2024 | |
| 1.1.2 | 225 | 7/31/2024 | |
| 1.1.1 | 257 | 7/15/2024 | |
| 1.1.0 | 306 | 6/21/2024 | |
| 1.0.6 | 286 | 6/17/2024 |