DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus
2024.0.14.6-preview-2390101
This is a prerelease version of DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus.
dotnet add package DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus --version 2024.0.14.6-preview-2390101
NuGet\Install-Package DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus -Version 2024.0.14.6-preview-2390101
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.MassTransit.AzureServiceBus" Version="2024.0.14.6-preview-2390101" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus --version 2024.0.14.6-preview-2390101
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus, 2024.0.14.6-preview-2390101"
#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.MassTransit.AzureServiceBus as a Cake Addin #addin nuget:?package=DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus&version=2024.0.14.6-preview-2390101&prerelease // Install DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus as a Cake Tool #tool nuget:?package=DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus&version=2024.0.14.6-preview-2390101&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Azure Service Bus with MassTransit Integration for Event PubSub Library
© 2024 DotNet Brightener
Versions
Library | Version |
---|---|
EventPubSub Core | |
MassTransit Integration Library | |
Dependency Injection Library | |
Azure Service Bus with MassTransit Library | |
RabbitMq with MassTransit Library |
Installation
dotnet package add DotNetBrightener.Plugins.EventPubSub
dotnet package add DotNetBrightener.Plugins.EventPubSub.DependencyInjection
dotnet package add DotNetBrightener.Plugins.EventPubSub.MassTransit
dotnet package add DotNetBrightener.Plugins.EventPubSub.MassTransit.AzureServiceBus
# or
dotnet add package DotNetBrightener.Plugins.EventPubSub.MassTransit.RabbitMq
Usage
Configuration
Option 1: Use IConfiguration
to configure the service bus
// Initialize EventPubSubService
var eventPubSubConfig = builder.Services
.AddEventPubSubService()
// scan for event messages in the given assembly
.AddEventMessagesFromAssemblies(Assembly.GetExecutingAssembly(), typeof(DistributedTestMessage).Assembly)
// scan for event handlers in the given assembly
.AddEventHandlersFromAssemblies(Assembly.GetExecutingAssembly());
var massTransitConfigurator = eventPubSubConfig.EnableMassTransit();
// Add Azure Service Bus
massTransitConfigurator.UseAzureServiceBus(builder.Configuration);
// this should be called before builder.Build(), or before exiting ConfigureServices method
massTransitConfigurator.Finalize();
In your appsettings.json
file, add the the following configuration:
"ServiceBusConfiguration": {
"ConnectionString": "<your-endpoint-to-azure-service-bus>",
"SubscriptionName": "<application-name>",
"IncludeNamespaceForTopicName": false
}
Option 2: Configure from code
// Initialize EventPubSubService
var eventPubSubConfig = builder.Services
.AddEventPubSubService()
// scan for event messages in the given assembly
.AddEventMessagesFromAssemblies(Assembly.GetExecutingAssembly(), typeof(DistributedTestMessage).Assembly)
// scan for event handlers in the given assembly
.AddEventHandlersFromAssemblies(Assembly.GetExecutingAssembly());
var massTransitConfigurator = eventPubSubConfig.EnableMassTransit();
massTransitConfigurator.SetSubscriptionName("<application-name>");
// if you want to exclude namespace in entity name
massTransitConfigurator.ExcludeNamespaceInEntityName();
// Add Azure Service Bus
massTransitConfigurator.UseAzureServiceBus("<azure-connection-string>");
// this should be called before builder.Build(), or before exiting ConfigureServices method
massTransitConfigurator.Finalize();
Refer to the Event PubSub Library, MassTransit Integration Library for more details on how to configure the event messages, request/response messages and how to implement handlers for them.
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
- DotNetBrightener.Plugins.EventPubSub (>= 2024.0.14.6-preview-2390101)
- DotNetBrightener.Plugins.EventPubSub.MassTransit (>= 2024.0.14.6-preview-2390101)
- MassTransit.Azure.ServiceBus.Core (>= 8.2.5)
- 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)
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 |
---|---|---|
2024.0.14.6-preview-2390101 | 62 | 8/26/2024 |
2024.0.14.6-preview-2381603 | 66 | 8/25/2024 |