LightMediator.EventBus.AzureServiceBus
0.5.1.12
dotnet add package LightMediator.EventBus.AzureServiceBus --version 0.5.1.12
NuGet\Install-Package LightMediator.EventBus.AzureServiceBus -Version 0.5.1.12
<PackageReference Include="LightMediator.EventBus.AzureServiceBus" Version="0.5.1.12" />
<PackageVersion Include="LightMediator.EventBus.AzureServiceBus" Version="0.5.1.12" />
<PackageReference Include="LightMediator.EventBus.AzureServiceBus" />
paket add LightMediator.EventBus.AzureServiceBus --version 0.5.1.12
#r "nuget: LightMediator.EventBus.AzureServiceBus, 0.5.1.12"
#addin nuget:?package=LightMediator.EventBus.AzureServiceBus&version=0.5.1.12
#tool nuget:?package=LightMediator.EventBus.AzureServiceBus&version=0.5.1.12
LightMediator.EventBus.AzureServiceBus
LightMediator.EventBus.AzureServiceBus is an extension for LightMediator and LightMediator.EventBus that adds distributed messaging support using AzureServiceBus.
It enables publishing and subscribing to INotification
messages between services, applications, or domains in a decoupled and scalable way — powered by AzureServiceBus and your high-performance, lightweight mediator.
✨ Features
- 🔄 Publish/Subscribe using Topic/Queue model over AzureServiceBus.
- 💡 Built on top of
LightMediator.EventBus
. - 🔌 Easy integration with minimal configuration.
- 🔒 Supports durable queues and automatic reconnects.
📦 Installation
Install via NuGet:
dotnet add package LightMediator.EventBus.AzureServiceBus
Or via the Package Manager:
Install-Package LightMediator.EventBus.AzureServiceBus
🚀 Getting Started
1. Register LightMediator with AzureServiceBus support
In your Program.cs
or Startup.cs
:
builder.Services.AddLightMediator(options =>
{
options.IgnoreNamespaceInAssemblies = true;
options.IgnoreNotificationDifferences = true;
options.RegisterNotificationsByAssembly = true;
options.RegisterRequestsByAssembly = true;
options.Assemblies = new[]
{
Assembly.GetExecutingAssembly(),
Lib1.GetServiceAssembly(),
Lib2.GetServiceAssembly(),
Service1.GetServiceAssembly()
};
options.AddLightMediatorEventBus(services)
.UseAzureServiceBus(builder.Configuration.GetSection("AzureServiceBusSettings"));
});
2. Create a Notification
using LightMediator;
namespace WorkerService1.Events;
internal class TestEvent:INotification
{
public string MyProperty { get; set; }
}
3. Handle the Notification in another service
using LightMediator;
using WorkerService2.Events;
namespace WorkerService2.EventHandlers;
internal class TestEventHandler : NotificationHandler<TestEvent>
{
private readonly ILogger<TestEventHandler> _logger;
public TestEventHandler(ILogger<TestEventHandler> logger)
{
_logger = logger;
}
public override Task Handle(TestEvent message, CancellationToken? cancellationToken)
{
_logger.LogInformation($"___________________Event recieved__________________ {message.MyProperty}");
return Task.CompletedTask;
}
}
4. Publish a Notification as a Event using eventbus extension method
await _mediator.PublishEvent(new TestEvent() { MyProperty = "Hello"});
The message will be delivered to all services that registered the same
Topic
and are listening for that notification.
📝 License
This project is licensed under the MIT License.
Created with ❤️ by @omidmloo
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net9.0
- LightMediator.EventBus (>= 0.5.1.12)
- MassTransit (>= 8.4.1)
- MassTransit.Azure.ServiceBus.Core (>= 8.4.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Added AzureServiceBus messaging service