Sora.Data.Cqrs.Outbox.Mongo
0.2.20
dotnet add package Sora.Data.Cqrs.Outbox.Mongo --version 0.2.20
NuGet\Install-Package Sora.Data.Cqrs.Outbox.Mongo -Version 0.2.20
<PackageReference Include="Sora.Data.Cqrs.Outbox.Mongo" Version="0.2.20" />
<PackageVersion Include="Sora.Data.Cqrs.Outbox.Mongo" Version="0.2.20" />
<PackageReference Include="Sora.Data.Cqrs.Outbox.Mongo" />
paket add Sora.Data.Cqrs.Outbox.Mongo --version 0.2.20
#r "nuget: Sora.Data.Cqrs.Outbox.Mongo, 0.2.20"
#:package Sora.Data.Cqrs.Outbox.Mongo@0.2.20
#addin nuget:?package=Sora.Data.Cqrs.Outbox.Mongo&version=0.2.20
#tool nuget:?package=Sora.Data.Cqrs.Outbox.Mongo&version=0.2.20
Sora.Data.Cqrs.Outbox.Mongo
MongoDB-backed IOutboxStore for Sora'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
Sora:Cqrs:Outbox:Mongo
). Connection will resolve in this order:
- options.ConnectionString (explicit)
- Sora:Data:Sources:{name}:mongo:ConnectionString (named source; {name} = ConnectionStringName, default "mongo")
- ConnectionStrings:{name}
Example appsettings.json (named connection via ConnectionStrings)
{
"Sora": {
"Cqrs": {
"Outbox": {
"Mongo": {
// ConnectionStringName defaults to "mongo"; set explicitly if you like
"ConnectionStringName": "mongo",
"Database": "sora",
"Collection": "Outbox",
"LeaseSeconds": 30,
"MaxAttempts": 10
}
}
}
},
"ConnectionStrings": {
"mongo": "mongodb://localhost:27017"
}
}
Alternative (inline connection string under Sora:Cqrs:Outbox:Mongo)
{
"Sora": {
"Cqrs": {
"Outbox": {
"Mongo": {
"ConnectionString": "mongodb://localhost:27017",
"Database": "sora",
"Collection": "Outbox"
}
}
}
}
}
- Register the store in your service setup:
services.AddMongoOutbox(); // binds from Sora: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 = "sora"; 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 Sora.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
- MongoDB.Driver (>= 2.25.0)
- Sora.Data.Cqrs (>= 0.2.20)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
See release notes: https://github.com/sylin-labs/sora-framework/releases