Fluens.Messaging 0.6.2

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

Fluens.Messaging

Inbox/outbox messaging pattern for modular applications.

Installation

dotnet add package Fluens.Messaging

Usage

Setup

// Host setup
fluensBuilder.AddMessaging();

// Module setup (inside IModuleSetup.RegisterServices)
// Consumers are auto-discovered from the module assembly
module.AddMessaging<OrdersDbContext>(msg =>
{
    msg.Publishes<OrderCreatedMessage>();
});

DbContext Configuration

Register the outbox interceptor and messaging entity configurations in your module DbContext:

// In AddDbContext registration
services.AddDbContext<OrdersDbContext>((sp, options) =>
{
    options.AddOutboxInterceptor(sp); // Enables atomic outbox writes
});

// In DbContext.OnModelCreating
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.HasDefaultSchema("orders");
    modelBuilder.ApplyConfigurationsFromAssembly(typeof(OrdersDbContext).Assembly);
    modelBuilder.ApplyMessagingConfigurations("orders"); // Registers OutboxMessage, InboxMessage, DeadLetter
}

Publishing

public record OrderCreatedMessage(Guid OrderId) : IMessage;

// Publish is synchronous — message is stored in outbox during SaveChangesAsync
publisher.Publish(new OrderCreatedMessage(order.ID));
await dbContext.SaveChangesAsync(); // Outbox interceptor writes message

Consuming

public class OrderCreatedConsumer : IMessageConsumer<OrderCreatedMessage>
{
    public async Task ConsumeAsync(
        OrderCreatedMessage message,
        MessageContext context,
        CancellationToken ct)
    {
        // Process the message
    }
}

Architecture: Publish (sync, in-memory) → Outbox (EF SaveChanges interceptor) → Transport (background worker) → Inbox (per-module processor) → Consumer. Failed messages are moved to a dead_letters table.

Configuration

MessagingOptions is bound from the "Fluens:Messaging" configuration section:

Property Default Description
OutboxBatchSize 100 Max outbox messages fetched per transport cycle
InboxBatchSize 100 Max inbox messages fetched per processing cycle
InboxMaxRetries 3 Max retries before a message is moved to dead letters
InboxProcessorIntervalSeconds 30 Polling interval in seconds for the inbox processor
TransportProcessorIntervalSeconds 60 Polling interval in seconds for the outbox transport processor
{
  "Fluens": {
    "Messaging": {
      "OutboxBatchSize": 100,
      "InboxBatchSize": 100,
      "InboxMaxRetries": 3,
      "InboxProcessorIntervalSeconds": 30,
      "TransportProcessorIntervalSeconds": 60
    }
  }
}

Graceful Shutdown

Both MessageTransportProcessor and InboxProcessor support cooperative cancellation:

  • Batch loops check the cancellation token between iterations — unprocessed messages are picked up on next startup (at-least-once)
  • OperationCanceledException during shutdown is not treated as a processing failure — no retry count increment, no dead letter moves
  • Messages interrupted by shutdown retain their current retry count

License

This project is licensed under the MIT License.

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
0.6.2 0 3/2/2026
0.6.1 0 3/2/2026
0.6.0 26 3/1/2026
0.5.7 26 3/1/2026
0.5.6 28 3/1/2026
0.5.5 31 2/28/2026
0.5.4 30 2/28/2026
0.5.3 35 2/27/2026
0.5.2 31 2/27/2026
0.5.1 32 2/27/2026
0.5.0 37 2/26/2026
0.3.2 38 2/26/2026
0.3.1 31 2/26/2026
0.3.0 35 2/24/2026
0.2.5 40 2/24/2026
0.2.4 33 2/24/2026
0.2.3 36 2/24/2026
0.1.0 39 2/23/2026