Yautbox 1.0.1
dotnet add package Yautbox --version 1.0.1
NuGet\Install-Package Yautbox -Version 1.0.1
<PackageReference Include="Yautbox" Version="1.0.1" />
<PackageVersion Include="Yautbox" Version="1.0.1" />
<PackageReference Include="Yautbox" />
paket add Yautbox --version 1.0.1
#r "nuget: Yautbox, 1.0.1"
#:package Yautbox@1.0.1
#addin nuget:?package=Yautbox&version=1.0.1
#tool nuget:?package=Yautbox&version=1.0.1
Yautbox
Yautbox is a lightweight .NET outbox library. It lets you enqueue messages during application work and processes them later with background handlers. The core package is storage-agnostic; choose an infrastructure provider (InMemory, MSSQL, Postgres) or implement your own.
Features
- Outbox pattern with background processing
- Typed handlers with retry support
- Scheduled messages and visibility timeouts
- Configurable concurrency, polling, and cleanup
- Pluggable storage via
IOutboxProvider
Installation
NuGet (if published):
dotnet add package Yautbox
From source:
dotnet add <your-app>.csproj reference src/Yautbox/Yautbox.csproj
Quick start
- Register the outbox and a provider.
using Microsoft.Extensions.DependencyInjection;
using Yautbox.Extensions.Ioc;
using Yautbox.InMemory.Extensions; // from Yautbox.InMemory package
services.AddOutbox(builder => builder.UseInMemory());
- Register a handler for a payload type.
using Yautbox.Extensions.Ioc;
using Yautbox.Handlers;
services.AddOutboxHandler<OrderPlaced, OrderPlacedHandler>();
public sealed class OrderPlacedHandler : IOutboxHandler<OrderPlaced>
{
public Task HandleAsync(IEnumerable<OutboxMessage<OrderPlaced>> messages, CancellationToken ct)
{
foreach (var message in messages)
{
// process message.Payload
// message.Retry(TimeSpan.FromMinutes(1)); // optional retry
}
return Task.CompletedTask;
}
}
- Enqueue messages from your app code.
using Yautbox.Services;
await outbox.HandleAsync(new OrderPlaced("A-123"));
await outbox.HandleAsync(new OrderPlaced("B-456"), scheduledAt: DateTimeOffset.UtcNow.AddMinutes(5));
Cancel by id if needed:
await outbox.CancelAsync<OrderPlaced>(messageId);
Configuration options
Each handler can be configured via AddOutboxHandler().ConfigureOptions<TOptions>(). The default options type is DefaultRunnerOptions.
using Microsoft.Extensions.Options;
using Yautbox.Extensions.Ioc;
using Yautbox.Runner.Options;
services
.AddOutboxHandler<OrderPlaced, OrderPlacedHandler>()
.ConfigureOptions<DefaultRunnerOptions>(options =>
options.Configure(o =>
{
o.BufferSize = 500;
o.WorkersCount = 2;
o.ExecutionPolicy = ExecutionPolicy.Parallel;
o.BackupInterval = TimeSpan.FromHours(24);
}));
IOutboxRunnerOptions settings:
Identifier(default: type name without version info)PollDelay(default: 5s)BufferSize(default: 1000)PerBufferCount(default: 1000)HandleTimeout(default: 30m)IsEnabled(default: true)WorkersCount(default: 1)DeletePolicy(default: Safe)FailureDelay(default: 2s)Visibility(default: 10m)BackupInterval(default: null, disabled)ExecutionPolicy(default: Parallel)CancellationPolicy(default: Safe)
How it works
IOutboxServiceenqueues messages into anIOutboxProvider.AddOutboxHandler<TPayload, THandler>()registers two hosted services:- a handler runner that polls, locks, and dispatches messages
- a cleanup runner that deletes old handled records when
BackupIntervalis set
ExecutionPolicy.Sequentialuses a provider-level lock to ensure a single worker across processes.
Extensibility
To create a custom storage implementation, implement IOutboxProvider and register it via AddOutbox(builder => builder.SetProvider<...>()).
Target frameworks
net8.0, net9.0, net10.0
| 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Polly (>= 8.6.5)
- Scrutor (>= 7.0.0)
- StronglyTypedId (>= 0.2.1)
- System.Linq.Async (>= 7.0.0)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Polly (>= 8.6.5)
- Scrutor (>= 7.0.0)
- StronglyTypedId (>= 0.2.1)
- System.Linq.Async (>= 7.0.0)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Polly (>= 8.6.5)
- Scrutor (>= 7.0.0)
- StronglyTypedId (>= 0.2.1)
- System.Linq.Async (>= 7.0.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Yautbox:
| Package | Downloads |
|---|---|
|
Yautbox.InMemory
In-memory Yautbox provider using a bounded in-process queue. Ideal for tests and local development where durability is not required. |
|
|
Yautbox.Mssql
SQL Server provider for Yautbox with schema migrations and distributed locks for sequential execution. |
|
|
Yautbox.Postgres
PostgreSQL provider for Yautbox with schema migrations and advisory locks for sequential execution. |
GitHub repositories
This package is not used by any popular GitHub repositories.