HoneyDrunk.Data.Outbox.Dispatcher
0.7.0
dotnet add package HoneyDrunk.Data.Outbox.Dispatcher --version 0.7.0
NuGet\Install-Package HoneyDrunk.Data.Outbox.Dispatcher -Version 0.7.0
<PackageReference Include="HoneyDrunk.Data.Outbox.Dispatcher" Version="0.7.0" />
<PackageVersion Include="HoneyDrunk.Data.Outbox.Dispatcher" Version="0.7.0" />
<PackageReference Include="HoneyDrunk.Data.Outbox.Dispatcher" />
paket add HoneyDrunk.Data.Outbox.Dispatcher --version 0.7.0
#r "nuget: HoneyDrunk.Data.Outbox.Dispatcher, 0.7.0"
#:package HoneyDrunk.Data.Outbox.Dispatcher@0.7.0
#addin nuget:?package=HoneyDrunk.Data.Outbox.Dispatcher&version=0.7.0
#tool nuget:?package=HoneyDrunk.Data.Outbox.Dispatcher&version=0.7.0
HoneyDrunk.Data.Outbox.Dispatcher
Background service that polls the transactional outbox and publishes pending messages through HoneyDrunk.Transport abstractions.
Shape
Shape A: Library with BackgroundService.
Nodes enable the dispatcher by calling AddOutboxDispatcher(). The hosted
service polls the outbox, publishes through Transport, and manages retry state.
What's Inside
| Type | Purpose |
|---|---|
OutboxDispatcherService |
BackgroundService + IOutboxDispatcher — poll / claim / publish / retry loop |
OutboxDispatcherOptions |
Batch size, poll interval, lease duration, retry policy, default destination |
AddOutboxDispatcher() |
DI registration extension |
Design Constraints
- Publishes via Transport interfaces only —
ITransportPublisher,IEndpointAddress,ITransportEnvelope. - No Azure Service Bus reference — adapter-agnostic.
- Lease-based concurrency — claims messages with a time-bound lease; crashed dispatchers recover automatically.
Integration Contract
Request Handler ──write──> IOutboxWriter ──(same DB txn)──> OutboxMessages table
│
OutboxDispatcherService ──poll──> IOutboxReader ──claim batch──> │
──publish──> ITransportPublisher ──> Message Bus
──mark──> IOutboxReader.MarkDispatchedAsync()
State Machine
Pending ── ClaimBatch ──▶ Leased ── Publish OK ──▶ Dispatched
│
├── Publish Fail (retries left) ──▶ Pending (via ReleaseForRetry)
└── Publish Fail (exhausted) ──▶ DeadLetter
Guarantees
| Concern | Owner |
|---|---|
| Transactional persistence | Data (EfOutboxWriter + UnitOfWork) |
| Message delivery | Transport (ITransportPublisher + adapter) |
| Retry & backoff | Dispatcher (OutboxDispatcherService) |
| Concurrency safety | Data (EfOutboxReader CAS + lease expiry) |
Setup
services.AddOutboxDispatcher(opts =>
{
opts.PollInterval = TimeSpan.FromSeconds(10);
opts.BatchSize = 100;
opts.LeaseDuration = TimeSpan.FromMinutes(5);
| Product | Versions 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. |
-
net10.0
- HoneyDrunk.Data.Outbox (>= 0.7.0)
- HoneyDrunk.Data.Outbox.Abstractions (>= 0.7.0)
- HoneyDrunk.Transport (>= 0.7.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
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: 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.