Koan.Data.Cqrs.Outbox.Mongo
0.5.2
dotnet add package Koan.Data.Cqrs.Outbox.Mongo --version 0.5.2
NuGet\Install-Package Koan.Data.Cqrs.Outbox.Mongo -Version 0.5.2
<PackageReference Include="Koan.Data.Cqrs.Outbox.Mongo" Version="0.5.2" />
<PackageVersion Include="Koan.Data.Cqrs.Outbox.Mongo" Version="0.5.2" />
<PackageReference Include="Koan.Data.Cqrs.Outbox.Mongo" />
paket add Koan.Data.Cqrs.Outbox.Mongo --version 0.5.2
#r "nuget: Koan.Data.Cqrs.Outbox.Mongo, 0.5.2"
#:package Koan.Data.Cqrs.Outbox.Mongo@0.5.2
#addin nuget:?package=Koan.Data.Cqrs.Outbox.Mongo&version=0.5.2
#tool nuget:?package=Koan.Data.Cqrs.Outbox.Mongo&version=0.5.2
Koan.Data.Cqrs.Outbox.Mongo
MongoDB-backed IOutboxStore for Koan's implicit CQRS pipeline.
- Durable outbox storage using MongoDB
- Leased dequeuing to avoid concurrent delivery
- Unique index on DedupKey (if provided in the future)
Quick start
- Just reference this package and the provider will be discovered automatically. The outbox selector picks the highest ProviderPriority and prefers Mongo over the in-memory default.
- Optionally, call services.AddMongoOutbox() to register explicitly or to override options in code.
Install and enable
- Configure from appsettings (bound from
Koan:Cqrs:Outbox:Mongo
). Connection will resolve in this order:
- options.ConnectionString (explicit)
- Koan:Data:Sources:{name}:mongo:ConnectionString (named source; {name} = ConnectionStringName, default "mongo")
- ConnectionStrings:{name}
Example appsettings.json (named connection via ConnectionStrings)
{
"Koan": {
"Cqrs": {
"Outbox": {
"Mongo": {
// ConnectionStringName defaults to "mongo"; set explicitly if you like
"ConnectionStringName": "mongo",
"Database": "Koan",
"Collection": "Outbox",
"LeaseSeconds": 30,
"MaxAttempts": 10
}
}
}
},
"ConnectionStrings": {
"mongo": "mongodb://localhost:27017"
}
}
Alternative (inline connection string under Koan:Cqrs:Outbox:Mongo)
{
"Koan": {
"Cqrs": {
"Outbox": {
"Mongo": {
"ConnectionString": "mongodb://localhost:27017",
"Database": "Koan",
"Collection": "Outbox"
}
}
}
}
}
- Register the store in your service setup:
services.AddMongoOutbox(); // binds from Koan:Cqrs:Outbox:Mongo and defaults name to "mongo"
Or override via options:
services.AddMongoOutbox(o ⇒ { o.ConnectionStringName = "custom-mongo"; // or set o.ConnectionString directly o.Database = "Koan"; o.Collection = "Outbox"; o.LeaseSeconds = 30; o.MaxAttempts = 10; });
Notes:
- Cqrs initializer registers a default in-memory outbox. Adding Mongo will override it (highest ProviderPriority wins; explicit registration also works).
- The outbox processor (in Koan.Data.Cqrs) will pick up this store automatically.
Schema and indexes
The store creates indexes on:
- Status + VisibleAt (for efficient pending scans)
- LeaseUntil (to reclaim expired leases)
- DedupKey (unique, sparse)
Product | Versions 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. |
-
net9.0
- Koan.Data.Cqrs (>= 0.5.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- MongoDB.Driver (>= 2.25.0)
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.5.2 | 255 | 9/16/2025 |
See release notes: https://github.com/sylin-labs/Koan-framework/releases