HoneyDrunk.Data.Outbox 0.7.0

dotnet add package HoneyDrunk.Data.Outbox --version 0.7.0
                    
NuGet\Install-Package HoneyDrunk.Data.Outbox -Version 0.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HoneyDrunk.Data.Outbox" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HoneyDrunk.Data.Outbox" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="HoneyDrunk.Data.Outbox" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HoneyDrunk.Data.Outbox --version 0.7.0
                    
#r "nuget: HoneyDrunk.Data.Outbox, 0.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HoneyDrunk.Data.Outbox@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HoneyDrunk.Data.Outbox&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=HoneyDrunk.Data.Outbox&version=0.7.0
                    
Install as a Cake Tool

HoneyDrunk.Data.Outbox

EF Core persistence implementation for the HoneyDrunk.Data transactional outbox.

What's Inside

Type Purpose
EfOutboxWriter<TContext> Adds outbox messages to the change tracker for atomic commit
EfOutboxReader<TContext> Lease-based batch retrieval with compare-and-swap concurrency and expired-lease recovery
OutboxMessageConfiguration EF entity type configuration (table, indexes, concurrency token, LeasedUntil, LastError)
ModelBuilderExtensions ApplyOutboxConfiguration() extension for ModelBuilder
OutboxHeaderSerializer System.Text.Json serialization for the headers dictionary

Design Constraints

  • No bus references — does not know about Transport, Service Bus, or any broker.
  • Only persist, fetch, update — never publishes messages.
  • Concurrency-safeStatus is an EF concurrency token; per-message CAS prevents double-dispatch.
  • Lease recovery — messages with expired leases are automatically reclaimed by the next poll cycle.

Setup

1. Apply Entity Configuration

public class AppDbContext : HoneyDrunkDbContext
{
    protected override void ApplyConfigurations(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyOutboxConfiguration(); // schema: "outbox", table: "OutboxMessages"
    }
}

2. Register Services

services
    .AddHoneyDrunkData()
    .AddHoneyDrunkDataEntityFramework<AppDbContext>(...)
    .AddHoneyDrunkDataOutbox<AppDbContext>();

3. Add Migration

dotnet ef migrations add AddOutbox --context AppDbContext

Context Enrichment

When OutboxOptions.AutoPopulateFromContext is enabled, EfOutboxWriter<TContext> requires a current Kernel IOperationContext and writes both CorrelationId and TenantId onto each message. If no operation context is available, callers must provide explicit non-empty CorrelationId and TenantId values on the message; otherwise the writer fails fast instead of persisting partial Grid context.

Concurrency Strategy

ClaimBatchAsync uses an atomic per-message ExecuteUpdateAsync with a WHERE Status = Pending (or Status = Leased AND LeasedUntil <= UtcNow) guard. The Status column is configured as an EF concurrency token, so only one instance can claim each message. Instances that lose the race silently skip the message.

For higher throughput on SQL Server, replace with a provider-specific reader using READPAST + UPDLOCK table hints.

State Machine

Pending ── ClaimBatchAsync ──▶ Leased ── MarkDispatchedAsync ──▶ Dispatched
                                 │
                                 ├── ReleaseForRetryAsync ──▶ Pending (retry)
                                 └── DeadLetterAsync ──▶ DeadLetter
                                 │
                            (lease expires) ──▶ reclaimed by next ClaimBatchAsync
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HoneyDrunk.Data.Outbox:

Package Downloads
HoneyDrunk.Data.Outbox.Dispatcher

Background dispatcher for the HoneyDrunk.Data transactional outbox. Polls pending messages and publishes them through HoneyDrunk.Transport abstractions with lease-based concurrency, configurable retry, and exponential backoff. Adapter-agnostic — references no specific message bus.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0 498 5/27/2026
0.6.0 127 5/18/2026
0.5.1 125 5/4/2026
0.5.0 108 5/4/2026
0.4.0 117 4/25/2026
0.3.0 130 2/15/2026

v0.7.0: ADR-0011 D11 Sonar cleanup — IUnitOfWork<TContext> exposes ContextType DIM, CorrelationCommandInterceptor switches to a strict allow-list sanitizer, EF naming convention refactored under cognitive-complexity limit. Bumps Kernel 0.7.0→0.8.0, Vault* 0.5.0→0.7.0, Transport 0.6.0→0.7.1, Microsoft.EntityFrameworkCore* and Microsoft.Extensions.* 10.0.7→10.0.8.