EricksonLopez.Outbox Overview
EricksonLopez.Outbox (3.0.0 on NuGet, L3, 34,518 downloads) implements the Transactional Outbox and Inbox patterns with ArrayPoolBufferWriter<byte> serialization, FOR UPDATE SKIP LOCKED / lock-free polling across 7 database engines, 8 broker adapters, and zero-reflection Native AOT JSON/MessagePack/Protobuf support.
- Atomic business-state and event persistence: Events staged through
IOutbox.Publish(...)enlist in the same database transaction (DbTransactionContext/ToOutboxContext()) so business writes never diverge from emitted messages. - Idempotent Inbox deduplication:
EricksonLopez.InboxandEricksonLopez.Inbox.Abstractions(EricksonLopez.Outbox.Inbox) guarantee at-most-once consumer side effects backed byEricksonLopez.Idempotency.Abstractions. - Credential & payload hygiene (
v3.0.0):DefaultErrorSanitizermasks Bearer tokens and credentials (***REDACTED***), andDbTransactionContextrejects null transactions. - Namespace accuracy:
AddOutbox(),AddOutboxDispatcher(), andAddOutboxInbox()reside innamespace EricksonLopez.Outbox.Hosting;, whileRabbitMQBrokerPublisherresides innamespace EricksonLopez.Outbox.RabbitMQ;.
Rendering diagram…
flowchart LR Tx["DbTransactionContext"] --> Store["IOutboxRepository (PostgreSQL / SQL Server / ...)"] Store -- SKIP LOCKED --> Disp["OutboxDispatcher + RetryDispatcherInterceptor"] Disp --> Broker["IBrokerPublisher (RabbitMQ / Kafka / SQS / ...)"] Broker --> Inbox["IInboxDeduplication -> [InboxConsumer]"]
View accessible text summary and structure
Domain transaction writes both entity state and OutboxMessage rows atomically, the OutboxDispatcher polls with SKIP LOCKED to publish via IBrokerPublisher, and consumers deduplicate via Inbox.
flowchart LR
Tx["DbTransactionContext"] --> Store["IOutboxRepository (PostgreSQL / SQL Server / ...)"]
Store -- SKIP LOCKED --> Disp["OutboxDispatcher + RetryDispatcherInterceptor"]
Disp --> Broker["IBrokerPublisher (RabbitMQ / Kafka / SQS / ...)"]
Broker --> Inbox["IInboxDeduplication -> [InboxConsumer]"]Package Roster & Native AOT Status (36 / 38 Published)
Section titled “Package Roster & Native AOT Status (36 / 38 Published)”36 of 38 packages are published at 3.0.0 on NuGet (net8.0;net9.0;net10.0; netstandard2.0 for Roslyn tools; localVersion: 4.2.0 on disk), including EricksonLopez.Inbox and EricksonLopez.Inbox.Abstractions. Overall AOT status is Partial (31 Full, 5 Incompatible, 2 NotApplicable):
- Core, Inbox & Serialization (
Full,3.0.0):Outbox(1,940dl),Outbox.Abstractions(1,524),Inbox(763),Inbox.Abstractions(800),Outbox.Events(744),Outbox.Inbox(732),Outbox.Inbox.AspNetCore(736),Outbox.Inbox.Events(721),Outbox.EntityFrameworkCore(1,051),Outbox.Mediator(681),Outbox.Aspire(708),Outbox.Dapr(705),Serialization.MessagePack(726),Serialization.Protobuf(1,012). - Storage Providers (
Full,3.0.0):PostgreSql(1,245),SqlServer(1,083),MySql(1,095),MariaDb(680),Oracle(1,146),Sqlite(1,072),MongoDb(716). - Brokers (
Full,3.0.0):AwsSqs(1,134),AzureEventHubs(720),AzureServiceBus(1,075),GooglePubSub(1,108),Kafka(1,066),Nats(1,094),RabbitMQ(1,133),RedisStreams(1,047). - Incompatible Bus Bridges (
IsAotCompatible=false,3.0.0):Brighter(807),MassTransit(1,109),MediatR(694, deprecated in favor ofMediatorperADR-036),NServiceBus(709),Rebus(766). - Roslyn Tools (
NotApplicable,3.0.0,netstandard2.0):Analyzers(1,082,OUTBOX001–OUTBOX013),SourceGenerators(1,094,OUTBOXSG001–OUTBOXSG003). - Unpublished Local Packages (
localVersion: 4.2.0,Full):EricksonLopez.Inbox.PostgreSqlandEricksonLopez.Outbox.OpenTelemetry(0NuGet downloads — local workspace only).
Measured directly from BenchmarkDotNet.Artifacts (75 total rows: 40 measured, 35 na_error) on .NET 10.0.10 X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI (no NativeAOT reports):
CreateMessageMetadata: 1.985–2.39 ns / 56 B;CreateOutboxMessage: 67.764–78.069 ns / 208 BSerialize_BufferWriter: 53.83–78.51 ns / 32 B (small payload;323.54–336.76 nsmedium;3,379.6–3,419.04 nslarge — consistently 32 B vsSerialize_Allocatingup to102,573 B)InMemory_GetAlias: 1.369–1.391 ns / 0 B;InMemory_Resolve: 2.594–2.642 ns / 0 BOutbox_StoreAsync(comparison): 245.1–256.3 ns / 448 B vsCAP_StoreAsync(827.4–855.7 ns / 1,664 B) vsNServiceBus_StoreAsync(25,105.5–25,423.8 ns / 5,457 B)ZeroMiddlewares: 4.463 ns / 0 B;OneMiddleware: 8.866 ns / 0 B;ThreeMiddlewares: 10.761 ns / 0 Bna_errordisclosure (35rows): Database roundtrip, MassTransit, Wolverine, parallel, and fetch rows recordedMean = NAin the source BenchmarkDotNet artifacts and are excluded from measured comparisons.