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
                    
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="LightMediator.EventBus.AzureServiceBus" Version="0.5.1.12" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LightMediator.EventBus.AzureServiceBus" Version="0.5.1.12" />
                    
Directory.Packages.props
<PackageReference Include="LightMediator.EventBus.AzureServiceBus" />
                    
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 LightMediator.EventBus.AzureServiceBus --version 0.5.1.12
                    
#r "nuget: LightMediator.EventBus.AzureServiceBus, 0.5.1.12"
                    
#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.
#addin nuget:?package=LightMediator.EventBus.AzureServiceBus&version=0.5.1.12
                    
Install as a Cake Addin
#tool nuget:?package=LightMediator.EventBus.AzureServiceBus&version=0.5.1.12
                    
Install as a Cake Tool

LightMediator.EventBus.AzureServiceBus

NuGet License: MIT

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.5.1.12 80 5/23/2025
0.5.1 78 5/23/2025

- Added AzureServiceBus messaging service