LightMediator.EventBus 0.5.1.12

dotnet add package LightMediator.EventBus --version 0.5.1.12
                    
NuGet\Install-Package LightMediator.EventBus -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" 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" Version="0.5.1.12" />
                    
Directory.Packages.props
<PackageReference Include="LightMediator.EventBus" />
                    
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 --version 0.5.1.12
                    
#r "nuget: LightMediator.EventBus, 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&version=0.5.1.12
                    
Install as a Cake Addin
#tool nuget:?package=LightMediator.EventBus&version=0.5.1.12
                    
Install as a Cake Tool

LightMediator.EventBus

NuGet License

LightMediator.EventBus is an extension of the LightMediator library that provides support for EventBus-style communication between services, applications, or distributed components in a decoupled and efficient way.


✨ Features

  • 🔁 Publish-Subscribe pattern built on top of LightMediator
  • 🧩 Extensible architecture – plug into different transport layers (e.g., RabbitMQ, Azure Service Bus, SignalR, etc.)
  • 🛠️ Seamless integration with existing LightMediator pipelines
  • 📦 Lightweight and performant – zero external dependencies unless needed by transport
  • Unit-test friendly design

📦 Installation

Install via NuGet:

dotnet add package LightMediator.EventBus

🚀 Getting Started

public class OrderCreatedEvent : IEvent
{
    public Guid OrderId { get; init; }
}

public class OrderCreatedHandler : IEventHandler<OrderCreatedEvent>
{
    public Task HandleAsync(OrderCreatedEvent @event, CancellationToken cancellationToken)
    {
        Console.WriteLine($"Order created: {@event.OrderId}");
        return Task.CompletedTask;
    }
}

Then register the EventBus in your DI container:


services.AddLightMediator(options =>   // from LightMediator
{
    // Configure options for the mediator
    options.IgnoreNamespaceInAssemblies = true;
    options.IgnoreNotificationDifferences = true;
    options.RegisterNotificationsByAssembly = true;
    options.RegisterRequestsByAssembly = true;

    // specify the assemblies to scan for notifications
    options.Assemblies = new[]
    {
        Assembly.GetExecutingAssembly(),
        Lib1.GetServiceAssembly(),
        Lib2.GetServiceAssembly(), 
        Service1.GetServiceAssembly()
    };
    options.AddLightMediatorEventBus(services);   // from this package
},

Publish an event: Use PublishEvent extension method for light mediator to publish cross domain events

await lightMediator.PublishEvent(new OrderCreatedEvent { OrderId = Guid.NewGuid() });

🧱 Architecture

This library follows a simple EventBus pattern and leverages the core pipeline and handler resolution features of LightMediator. It abstracts away transport-specific logic so developers can focus on events and handlers.


📄 Dependencies

This package depends on:

  • LightMediator: A minimalistic and performant in-process mediator pattern library for .NET.

✅ Contributing

Contributions are welcome! Please feel free to open issues, submit pull requests, or suggest enhancements.


📝 License

This project is licensed under the MIT License.


💬 Contact

For support or questions, feel free to reach out via GitHub Issues or contact @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 (4)

Showing the top 4 NuGet packages that depend on LightMediator.EventBus:

Package Downloads
LightMediator.EventBus.SignalR

Signalr messaging service extension for lightmediator event bus

LightMediator.EventBus.RabbitMQ

RabbitMQ messaging service extension for lightmediator event bus

LightMediator.EventBus.MQTT

MQTT messaging service extension for lightmediator event bus

LightMediator.EventBus.AzureServiceBus

Azure Service Bus messaging service extension for lightmediator event bus

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.1.12 143 5/23/2025
0.5.1.10 159 5/22/2025
0.5.1.9 145 5/21/2025
0.5.1.6 154 5/18/2025
0.5.1.3 98 5/18/2025
0.5.1.1 273 5/13/2025
0.5.1 231 5/13/2025
0.5.0 214 5/12/2025

- Update readme and documentation
- correct project urls