ReliableCommandOutbox.Abstractions 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ReliableCommandOutbox.Abstractions --version 1.3.0
                    
NuGet\Install-Package ReliableCommandOutbox.Abstractions -Version 1.3.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="ReliableCommandOutbox.Abstractions" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ReliableCommandOutbox.Abstractions" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="ReliableCommandOutbox.Abstractions" />
                    
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 ReliableCommandOutbox.Abstractions --version 1.3.0
                    
#r "nuget: ReliableCommandOutbox.Abstractions, 1.3.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 ReliableCommandOutbox.Abstractions@1.3.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=ReliableCommandOutbox.Abstractions&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=ReliableCommandOutbox.Abstractions&version=1.3.0
                    
Install as a Cake Tool

ReliableCommandOutbox.Abstractions

ReliableCommandOutbox.Abstractions define los contratos públicos del patrón Transactional Command Outbox y su complemento Inbox (Idempotent Consumer).

Este paquete no contiene lógica, no contiene infraestructura y no ejecuta comandos.
Su objetivo es establecer un lenguaje común y estable entre productores, consumidores y el motor de procesamiento, respetando Clean Architecture.


Propósito

Este paquete existe para:

  • Definir cómo se representa la intención de ejecutar un comando externo
  • Definir cómo se despacha un comando fuera del microservicio
  • Definir cómo se decide retry o terminación
  • Definir cómo un consumidor implementa idempotencia (Inbox)
  • Evitar dependencias entre dominio, infraestructura y transporte

Qué incluye

Command Outbox (lado productor)

Contratos para garantizar la ejecución confiable de comandos externos:

  • Persistencia de la intención de ejecutar un comando
  • Ejecución asíncrona
  • Reintentos controlados
  • Auditoría explícita del ciclo de vida

Inbox (lado consumidor)

Contratos para consumo idempotente de comandos:

  • Deduplicación por commandId
  • Protección contra reintentos
  • Consumo transaccional seguro

Qué NO incluye

Este paquete NO:

  • ❌ Ejecuta comandos
  • ❌ Implementa persistencia
  • ❌ Usa Entity Framework, Dapper o SQL
  • ❌ Incluye schedulers (Quartz, cron, timers)
  • ❌ Conoce transporte (HTTP, gRPC, colas)
  • ❌ Implementa retry
  • ❌ Contiene lógica de negocio

Este paquete define contratos, no comportamiento.


Principios de diseño

  • Clean Architecture
  • Ports & Adapters
  • Separación productor / consumidor
  • Semánticas explícitas
  • Idempotencia consciente
  • Sin dependencias de infraestructura
  • Reutilizable vía NuGet
  • Orientado a sistemas críticos

Contratos incluidos

Command Outbox

Contrato Responsabilidad
CommandOutboxRecord Representa la intención persistida de ejecutar un comando
OutboxStatus Estados explícitos del ciclo de vida
ICommandOutboxRepository<T> Persistencia del outbox
ICommandDispatcher<T> Adaptador de salida
IRetryPolicy Decisión de reintentos
IClock Abstracción del tiempo
OutboxExecutionResult Normalización del resultado de ejecución

Inbox (Idempotent Consumer)

Contrato Responsabilidad
InboxRecord Representa un comando ya procesado
IInboxRepository<T> Deduplicación e idempotencia del consumidor

El Inbox no ejecuta lógica de negocio, solo protege su ejecución.


Modelo estructural (solo contratos)

classDiagram
    direction TB

    %% =========================
    %% COMMAND OUTBOX
    %% =========================
    class CommandOutboxRecord {
        <<abstract>>
        +Guid Id
        +string CommandName
        +string Target
        +string Payload
        +string BusinessKey
        +OutboxStatus Status
        +int RetryCount
        +int MaxRetries
        +DateTime NextAttemptAt
        +DateTime CreatedAt
        +DateTime? ProcessedAt
        +string? LastError
    }

    class OutboxStatus {
        <<enum>>
        Pending
        Processing
        Sent
        Failed
        Dead
    }

    class ICommandOutboxRepository~TRecord~ {
        <<interface>>
        +AddAsync(TRecord)
        +FetchNextAsync()
        +MarkProcessingAsync(Guid)
        +MarkAsSentAsync(Guid)
        +MarkAsFailedAsync(Guid, string)
        +MarkAsDeadAsync(Guid, string)
        +ScheduleRetryAsync(Guid, DateTime, string)
    }

    class ICommandDispatcher~TRecord~ {
        <<interface>>
        +DispatchAsync(TRecord)
    }

    class IRetryPolicy {
        <<interface>>
        +ShouldRetry(int, Exception?, OutboxExecutionResult?)
        +CalculateNextAttempt(int, DateTime)
    }

    class IClock {
        <<interface>>
        +UtcNow
    }

    class OutboxExecutionResult {
        +bool Success
        +bool Retryable
        +string? Error
    }

    %% =========================
    %% INBOX
    %% =========================
    class InboxRecord {
        <<abstract>>
        +Guid CommandId
        +string CommandName
        +string Source
        +DateTime ProcessedAt
    }

    class IInboxRepository~TRecord~ {
        <<interface>>
        +ExistsAsync(Guid)
        +AddAsync(TRecord)
    }

    %% =========================
    %% RELATIONSHIPS
    %% =========================
    CommandOutboxRecord --> OutboxStatus
    ICommandOutboxRepository~TRecord~ ..> CommandOutboxRecord
    ICommandDispatcher~TRecord~ ..> CommandOutboxRecord
    ICommandDispatcher~TRecord~ ..> OutboxExecutionResult
    IRetryPolicy ..> OutboxExecutionResult
    IInboxRepository~TRecord~ ..> InboxRecord
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.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ReliableCommandOutbox.Abstractions:

Package Downloads
ReliableCommandOutbox.Core

Motor determinístico del patrón Transactional Command Outbox. Coordina persistencia, ejecución, estados y reintentos de comandos externos.

ReliableCommandOutbox.Extensions

Extensiones de integración para registrar el motor ReliableCommandOutbox en Microsoft.Extensions.DependencyInjection.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 1,170 1/20/2026
1.4.0 142 1/19/2026
1.3.0 108 1/19/2026
1.2.0 170 1/15/2026
1.1.0 147 1/12/2026
1.0.0 194 1/2/2026