Chaos.Mongo.Outbox
0.7.0
See the version list below for details.
dotnet add package Chaos.Mongo.Outbox --version 0.7.0
NuGet\Install-Package Chaos.Mongo.Outbox -Version 0.7.0
<PackageReference Include="Chaos.Mongo.Outbox" Version="0.7.0" />
<PackageVersion Include="Chaos.Mongo.Outbox" Version="0.7.0" />
<PackageReference Include="Chaos.Mongo.Outbox" />
paket add Chaos.Mongo.Outbox --version 0.7.0
#r "nuget: Chaos.Mongo.Outbox, 0.7.0"
#:package Chaos.Mongo.Outbox@0.7.0
#addin nuget:?package=Chaos.Mongo.Outbox&version=0.7.0
#tool nuget:?package=Chaos.Mongo.Outbox&version=0.7.0
Chaos.Mongo.Outbox
A transactional outbox for MongoDB with typed payloads, at-least-once background delivery, retries, stale-lock recovery, and optional retention cleanup.
Installation
dotnet add package Chaos.Mongo.Outbox
Quick start
Define a payload and publisher:
using Chaos.Mongo;
using Chaos.Mongo.Outbox;
public sealed class OrderPlaced
{
public string OrderId { get; set; } = string.Empty;
}
public sealed class NotificationsPublisher : IOutboxPublisher
{
public Task PublishAsync(
OutboxMessage message,
CancellationToken cancellationToken = default)
{
var payload = message.DeserializePayload<OrderPlaced>();
return PublishToBrokerAsync(payload, cancellationToken);
}
private static Task PublishToBrokerAsync(
OrderPlaced payload,
CancellationToken cancellationToken) => Task.CompletedTask;
}
Register the core MongoDB services and outbox processor:
services.AddMongo("mongodb://localhost:27017", "myDatabase")
.WithOutbox(outbox => outbox
.WithPublisher<NotificationsPublisher>()
.WithMessage<OrderPlaced>("OrderPlaced")
.WithAutoStartProcessor());
Write the business change and message in the same transaction:
await mongo.ExecuteInTransaction(async (helper, session, cancellationToken) =>
{
await orders.InsertOneAsync(session, order, cancellationToken: cancellationToken);
await outbox.AddMessageAsync(
session,
new OrderPlaced { OrderId = order.Id.ToString() },
correlationId: order.Id.ToString(),
cancellationToken: cancellationToken);
});
MongoDB transaction support is required for atomic business and outbox writes. The processor must be started automatically or through IOutboxProcessor for messages to be delivered.
Package relationships
This package references Chaos.Mongo, which provides MongoDB registration and transaction helpers. Chaos.Mongo.EventStore is optional and can add outbox messages through event-store transactional callbacks.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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 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
- Chaos.Mongo (>= 0.7.0)
-
net8.0
- Chaos.Mongo (>= 0.7.0)
-
net9.0
- Chaos.Mongo (>= 0.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# v0.7.0 (2026-08-05)
- No changes since last release