DotNetBrightener.Plugins.EventPubSub.AzureServiceBus
2024.0.12.14114
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DotNetBrightener.Plugins.EventPubSub.AzureServiceBus --version 2024.0.12.14114
NuGet\Install-Package DotNetBrightener.Plugins.EventPubSub.AzureServiceBus -Version 2024.0.12.14114
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="DotNetBrightener.Plugins.EventPubSub.AzureServiceBus" Version="2024.0.12.14114" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetBrightener.Plugins.EventPubSub.AzureServiceBus --version 2024.0.12.14114
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DotNetBrightener.Plugins.EventPubSub.AzureServiceBus, 2024.0.12.14114"
#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.
// Install DotNetBrightener.Plugins.EventPubSub.AzureServiceBus as a Cake Addin #addin nuget:?package=DotNetBrightener.Plugins.EventPubSub.AzureServiceBus&version=2024.0.12.14114 // Install DotNetBrightener.Plugins.EventPubSub.AzureServiceBus as a Cake Tool #tool nuget:?package=DotNetBrightener.Plugins.EventPubSub.AzureServiceBus&version=2024.0.12.14114
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Azure Service Bus Enabled for Event PubSub Library
© 2024 DotNet Brightener
Versions
Library | Version |
---|---|
EventPubSub Core | |
Azure Service Bus Library | |
Dependency Injection Library |
Installation
dotnet package add DotNetBrightener.Plugins.EventPubSub
dotnet package add DotNetBrightener.Plugins.EventPubSub.DependencyInjection
dotnet package add DotNetBrightener.Plugins.EventPubSub.AzureServiceBus
Usage
Option 1: Use IConfiguration
to configure the service bus
builder.Services
// Initialize EventPubSubService
.AddEventPubSubService(
Assembly.GetExecutingAssembly(),
// assemblies where the event messages are defined
typeof(DistributedTestMessage).Assembly
)
// Add Azure Service Bus
.AddAzureServiceBus(builder.Configuration)
// Add event handlers
.AddEventHandlersFromAssemblies([
Assembly.GetExecutingAssembly(),
// assemblies where the event handlers are defined
]);
In your appsettings.json
file, add the the following configuration:
"ServiceBusConfiguration": {
"ConnectionString": "<connection_string_to_Azure_Service_Bus",
"SubscriptionName": "<your_app_name>"
}
Option 2: Configure from code
builder.Services
// Initialize EventPubSubService
.AddEventPubSubService(
Assembly.GetExecutingAssembly(),
// assemblies where the event messages are defined
typeof(DistributedTestMessage).Assembly
)
// Add Azure Service Bus
.AddAzureServiceBus("<connection_string_to_Azure_Service_Bus>",
"<your_app_name>")
// Add event handlers
.AddEventHandlersFromAssemblies([
Assembly.GetExecutingAssembly(),
// assemblies where the event handlers are defined
]);
Default Configuration Value
If you use appsettings.json
to configure the service bus, you can also customize the following configuration values by adding it to the JSON:
Configuration | Description | Value Type | Default Value |
---|---|---|---|
ConnectionString | The connection string to Azure Service Bus | string | required , must specify |
SubscriptionName | The name of the application that subscribes to the events from Azure Service Bus | string | required , must specify |
AutoDeleteOnIdle | The TimeSpan idle interval after which the topic is automatically deleted. |
TimeSpan | TimeSpan.FromDays(90) , means the topic will be automatically deleted after 90 days. |
DefaultMessageTimeToLive | The default time to live value for the messages. This is the duration after which the message expires, starting from when the message is sent to Service Bus. | TimeSpan | TimeSpan.FromDays(5) |
DuplicateDetectionHistoryTimeWindow | The TimeSpan duration of duplicate detection history that is maintained by the service. |
TimeSpan | TimeSpan.FromMinutes(1) |
MaxSizeInMegabytes | The maximum size of the topic in megabytes, which is the size of memory allocated for the topic. | long | 5120 |
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Azure.Messaging.ServiceBus (>= 7.17.5)
- DotNetBrightener.Plugins.EventPubSub (>= 2024.0.12.14114)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.