NPv.Messaging.Abstractions 1.2.0

dotnet add package NPv.Messaging.Abstractions --version 1.2.0
                    
NuGet\Install-Package NPv.Messaging.Abstractions -Version 1.2.0
                    
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="NPv.Messaging.Abstractions" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NPv.Messaging.Abstractions" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="NPv.Messaging.Abstractions" />
                    
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 NPv.Messaging.Abstractions --version 1.2.0
                    
#r "nuget: NPv.Messaging.Abstractions, 1.2.0"
                    
#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.
#:package NPv.Messaging.Abstractions@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NPv.Messaging.Abstractions&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=NPv.Messaging.Abstractions&version=1.2.0
                    
Install as a Cake Tool

NPv.Messaging.Abstractions

Minimal and extensible messaging interfaces for .NET.
Built to support clean architecture, DDD, and event-driven design.


✨ Provided Interfaces

Interface Purpose
IEvent Marker interface for a domain event
IEventHandler<TEvent> Handles a single event of type TEvent
IEventDispatcher Dispatches events to all registered handlers
IEventHandlingErrorReporter Reports exceptions during handler execution
IOutbox Persists events for reliable later delivery
IEventQueue Sends events to an external queue system
IEventQueueConsumer Consumes and processes queued events

Note: Unit of Work abstractions now live in the separate package NPv.Uow.Abstractions.


🔧 Use Cases

  • Modular domain event handling
  • CQRS with the Outbox pattern
  • Transport-agnostic event queues
  • Clean and testable architecture

📦 NuGet

dotnet add package NPv.Messaging.Abstractions

🛠 Example

public class OrderCreatedEvent : IEvent { }

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

  • NPv.Messaging.Infrastructure — runtime implementations of these interfaces. (future library)

Author's Note

This library grew out of my long-standing personal interest in structuring and publishing open source packages. Over time, I’ve revisited and refined earlier internal utilities and ideas, giving them a more consistent shape and preparing them for wider reuse. Along the way, I’ve also taken the opportunity to explore how open source distribution and licensing work in the .NET ecosystem.

It’s a small step toward something I’ve always wanted to try — sharing practical, minimal tools that reflect years of learning, experimentation, and refinement.

Hopefully, someone finds it useful.

Nikolai 😛


⚖️ License

MIT — you are free to use this in commercial and open-source software.

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.
  • net9.0

    • No dependencies.

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
1.2.0 136 8/10/2025
1.0.1 101 5/23/2025
1.0.0 97 5/23/2025