Joselct.Outbox.Core 1.0.3

dotnet add package Joselct.Outbox.Core --version 1.0.3
                    
NuGet\Install-Package Joselct.Outbox.Core -Version 1.0.3
                    
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="Joselct.Outbox.Core" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Joselct.Outbox.Core" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Joselct.Outbox.Core" />
                    
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 Joselct.Outbox.Core --version 1.0.3
                    
#r "nuget: Joselct.Outbox.Core, 1.0.3"
                    
#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 Joselct.Outbox.Core@1.0.3
                    
#: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=Joselct.Outbox.Core&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Joselct.Outbox.Core&version=1.0.3
                    
Install as a Cake Tool

Joselct.Outbox.Core

Core abstractions and entities for the Joselct.Outbox library.

This package contains the contracts and domain model shared across all Joselct.Outbox packages. Reference it directly only if you need to share outbox contracts across multiple projects without pulling in the full infrastructure implementation.

Installation

dotnet add package Joselct.Outbox.Core

What's Included

Entities

OutboxMessage — represents a pending event stored in the outbox table.

// Create a message — automatically captures the current OpenTelemetry trace
var message = OutboxMessage.CreateWithCurrentTrace(new OrderCreatedEvent(order.Id));

// Create with explicit correlation id
var message = OutboxMessage.Create(new OrderCreatedEvent(order.Id), correlationId: "abc-123");

Abstractions

IOutboxPublisher — used by application handlers to store events in the outbox.

public interface IOutboxPublisher
{
    // Automatically captures the active OpenTelemetry trace
    Task PublishAsync<T>(T @event, CancellationToken ct = default) where T : class;

    // Explicit correlation id when no active trace is available
    Task PublishAsync<T>(T @event, string correlationId, CancellationToken ct = default) where T : class;
}

IOutboxDispatcher — used by the background processor to dispatch deserialized events.

public interface IOutboxDispatcher
{
    Task DispatchAsync(object @event, Type eventType, CancellationToken ct = default);
}

IOutboxRepository — persistence contract for outbox messages.

public interface IOutboxRepository
{
    Task AddAsync(OutboxMessage message, CancellationToken ct = default);
    Task<IReadOnlyList<OutboxMessage>> GetPendingAsync(int batchSize, CancellationToken ct = default);
    Task CommitAsync(CancellationToken ct = default);
}

Backoff Strategies

IBackoffStrategy — defines the delay between retries.

// Exponential — 30s, 1m, 4m, 8m, ... (capped at MaxDelay)
new ExponentialBackoffStrategy(baseDelay: TimeSpan.FromSeconds(30), maxDelay: TimeSpan.FromHours(6));

// Fixed — same delay between every retry
new FixedBackoffStrategy(delay: TimeSpan.FromSeconds(60));

Publisher vs Dispatcher

These two interfaces serve different purposes:

IOutboxPublisher IOutboxDispatcher
Used by Application handlers Background processor
Direction Write to outbox Read from outbox and deliver
When Inside a business transaction Asynchronously, after commit
Handler → IOutboxPublisher → outbox_messages table → IOutboxDispatcher → broker

Distributed Tracing

OutboxMessage stores the OpenTelemetry trace context (TraceId, SpanId, CorrelationId) when created. The background processor restores this context when dispatching, so the processing span appears as a child of the original request in tools like Jaeger or Zipkin.

HTTP Request (TraceId: abc)
  └── CreateOrder handler (SpanId: 111)
        └── OutboxProcessor (SpanId: 222)  ← linked to the original request

License

MIT

Product 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 was computed.  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 was computed.  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 (2)

Showing the top 2 NuGet packages that depend on Joselct.Outbox.Core:

Package Downloads
Joselct.Outbox.MediatR

MediatR dispatcher adapter for Joselct.Outbox.

Joselct.Outbox.EFCore

Entity Framework Core implementation for Joselct.Outbox.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 386 3/1/2026
1.0.2 155 2/28/2026
1.0.1 145 2/24/2026
1.0.0 133 2/24/2026