Fluens.Messaging
0.6.2
dotnet add package Fluens.Messaging --version 0.6.2
NuGet\Install-Package Fluens.Messaging -Version 0.6.2
<PackageReference Include="Fluens.Messaging" Version="0.6.2" />
<PackageVersion Include="Fluens.Messaging" Version="0.6.2" />
<PackageReference Include="Fluens.Messaging" />
paket add Fluens.Messaging --version 0.6.2
#r "nuget: Fluens.Messaging, 0.6.2"
#:package Fluens.Messaging@0.6.2
#addin nuget:?package=Fluens.Messaging&version=0.6.2
#tool nuget:?package=Fluens.Messaging&version=0.6.2
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)
OperationCanceledExceptionduring 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 | Versions 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. |
-
net10.0
- Fluens (>= 0.6.2)
- Fluens.Kernel (>= 0.6.2)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
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 |