Flux.Messaging 2.0.1

dotnet add package Flux.Messaging --version 2.0.1
                    
NuGet\Install-Package Flux.Messaging -Version 2.0.1
                    
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="Flux.Messaging" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Flux.Messaging" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Flux.Messaging" />
                    
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 Flux.Messaging --version 2.0.1
                    
#r "nuget: Flux.Messaging, 2.0.1"
                    
#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 Flux.Messaging@2.0.1
                    
#: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=Flux.Messaging&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Flux.Messaging&version=2.0.1
                    
Install as a Cake Tool

Flux.Messaging

Flux.Messaging is a messaging framework for .NET designed for Clean Architecture, DDD, and distributed systems.
It provides a unified model for:

  • Publish / Subscribe (fire-and-forget)
  • Distributed Command Bus
  • Strongly-typed handlers
  • Pluggable transports (InMemory, AMQP, etc.)

Flux.Messaging does not try to hide messaging complexity — it structures it properly.


Key Features

  • Clear separation between Bus, Dispatcher, and Transport
  • First-class support for distributed request-response
  • Contract-first design
  • DDD / CQRS / Event-Driven friendly
  • No dependency on ASP.NET
  • Ready for AMQP 1.0 (Qpid, Azure Service Bus, etc.)
  • InMemory transport for testing and local development

Packages

Package Description
Flux.Messaging.Abstractions Public contracts (Bus, Handlers, Envelope, Transport)
Flux.Messaging.Core Core implementations
Flux.Messaging.InMemory InMemory transport and dispatcher
Flux.Messaging.Extensions.DependencyInjection Developer Experience (DX)

Benchmarks


BenchmarkDotNet v0.15.8, Linux Debian GNU/Linux 13 (trixie)
Intel Xeon CPU E5-2680 v4 2.40GHz, 1 CPU, 28 logical and 14 physical cores
.NET SDK 10.0.103
  [Host]     : .NET 10.0.3 (10.0.3, 10.0.326.7603), X64 RyuJIT x86-64-v3
  DefaultJob : .NET 10.0.3 (10.0.3, 10.0.326.7603), X64 RyuJIT x86-64-v3


Method Mean Error StdDev Gen0 Allocated
Publish 1.168 μs 0.0060 μs 0.0057 μs 0.0305 576 B
Send 1.355 μs 0.0077 μs 0.0072 μs 0.0210 408 B

Core Concepts

Publish (Event)

  • Fire-and-forget
  • Multiple handlers supported
  • No response expected

Send (Command)

  • Command (CQRS)
  • Exactly one handler
  • Can cross process and service boundaries
  • No response expected (Expects ACK)

Installation

dotnet add package Flux.Messaging

Basic Setup (InMemory)

services.AddFluxMessaging()
        .UseInMemory();

Publish (Event)

Event definition

public record ProductAdded(Guid ProductId);

Handler

public sealed class ProductAddedHandler : IMessageHandler<ProductAdded>
{
    public Task HandleAsync(ProductAdded message, CancellationToken ct = default)
    {
        Console.WriteLine($"Product added: {message.ProductId}");
        return Task.CompletedTask;
    }
}

Publish

await messageBus.PublishAsync(new ProductAdded(productId));

Send

Command

public sealed record ReserveStockCommand(Guid ProductId, int Quantity);

Handler

public sealed class ReserveStockHandler : ICommandHandler<ReserveStockCommand>
{
    public Task HandleAsync(ReserveStock request, CancellationToken ct = default)
    {
        Console.WriteLine($"Reserving product {request.ProductId}.");
        return Task.CompletedTask;
    }
}

Send

await messageBus.SendAsync(new ReserveStock(productId, 2));

Architecture Overview

Application
 └─ IMessageBus
      ├─ Send (Command)
      └─ Publish (Event)

Infrastructure
 ├─ ITransport (AMQP, InMemory, etc.)
 └─ IMessageDispatcher
  • Bus: public API
  • Dispatcher: resolves handlers
  • Transport: delivers envelopes

The transport does not know handlers.
The dispatcher does not know the transport.


Cross-language interoperability

Flux.Messaging is .NET-first, but transport-agnostic.

Other languages can:

  • Consume AMQP envelopes
  • Deserialize the payload

No framework dependency is required.


Testing

The solution includes behavior-focused tests:

  • Concurrency
  • Multiple handlers
  • Fault tolerance
  • Dispatch correctness

License

This project is licensed under the Apache License, Version 2.0.
See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
2.0.1 121 2/16/2026
2.0.0 111 2/16/2026
1.2.3 119 2/7/2026
1.2.2 114 2/4/2026
1.2.1 117 2/4/2026
1.2.0 124 1/17/2026
1.1.0 119 1/16/2026
1.0.0 128 12/30/2025