Pipelink.Outbox 1.0.20

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

Pipelink.Outbox

A .NET library for implementing the outbox pattern with Entity Framework Core.

Overview

Pipelink.Outbox provides a simple and efficient way to implement the outbox pattern in your .NET applications using Entity Framework Core. The outbox pattern is a reliable way to handle message publishing in distributed systems, ensuring that messages are not lost even if the system fails.

Features

  • Easy integration with Entity Framework Core
  • Support for multiple message types
  • Automatic message publishing through background service
  • Configurable retry policies
  • Transactional message handling
  • Comprehensive test coverage
  • Support for batch processing
  • Detailed error tracking and logging

Installation

dotnet add package Pipelink.Outbox

Quick Start

  1. Configure your DbContext:
public class YourDbContext : DbContext
{
    public DbSet<OutboxMessage> OutboxMessages { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyConfiguration(new OutboxMessageConfiguration());
    }
}
  1. Use the outbox in your services:
public class YourService
{
    private readonly YourDbContext _context;
    private readonly IOutboxPublisher _publisher;

    public YourService(YourDbContext context, IOutboxPublisher publisher)
    {
        _context = context;
        _publisher = publisher;
    }

    public async Task ProcessOrder(Order order)
    {
        using var transaction = await _context.Database.BeginTransactionAsync();
        
        // Save your business data
        _context.Orders.Add(order);
        await _context.SaveChangesAsync();

        // Add message to outbox
        await _publisher.PublishAsync(order);
        await transaction.CommitAsync();
    }
}
  1. Configure the publisher and background service in your startup:
services.AddOutboxPublisher(options =>
{
    options.RetryCount = 3;
    options.RetryInterval = TimeSpan.FromSeconds(5);
    options.BatchSize = 100;
});

// Add the background service
services.AddHostedService<OutboxPublisherBackgroundService>();

Configuration Options

  • RetryCount: Number of retry attempts for failed messages (default: 3)
  • RetryInterval: Time between retry attempts (default: 5 seconds)
  • BatchSize: Number of messages to process in a single batch (default: 100)

Message Processing

The library includes a background service that automatically processes messages in the outbox. Messages go through the following states:

  1. Pending: Initial state when a message is added to the outbox
  2. Processing: When the message is being processed
  3. Completed: When the message is successfully processed
  4. Failed: When the message failed after all retry attempts

Error Handling

The library provides robust error handling:

  • Failed messages are automatically retried based on the configured retry count
  • Each failure is logged with detailed error information
  • Messages that exceed the retry count are marked as failed
  • Error details are stored with the message for debugging

Testing

The library includes comprehensive tests covering:

  • Message publishing
  • Message processing
  • Error handling
  • Retry mechanisms
  • Batch processing
  • Background service operation

To run the tests:

dotnet test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For support, please open an issue in the GitHub repository.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.20 159 4/22/2025
1.0.19 240 4/22/2025 1.0.19 is deprecated because it is no longer maintained.
1.0.18 238 4/22/2025 1.0.18 is deprecated because it is no longer maintained.
1.0.17 261 4/22/2025 1.0.17 is deprecated because it is no longer maintained.
1.0.16 248 4/22/2025 1.0.16 is deprecated because it is no longer maintained.
1.0.15 255 4/22/2025 1.0.15 is deprecated because it is no longer maintained.
1.0.14 272 4/22/2025 1.0.14 is deprecated because it is no longer maintained.
1.0.13 257 4/22/2025 1.0.13 is deprecated because it is no longer maintained.
1.0.12 258 4/22/2025 1.0.12 is deprecated because it is no longer maintained.
1.0.11 265 4/22/2025 1.0.11 is deprecated because it is no longer maintained.
1.0.10 260 4/22/2025 1.0.10 is deprecated because it is no longer maintained.
1.0.9 262 4/22/2025 1.0.9 is deprecated because it is no longer maintained.
1.0.7 265 4/22/2025 1.0.7 is deprecated because it is no longer maintained.
1.0.6 255 4/22/2025 1.0.6 is deprecated because it is no longer maintained.
1.0.5 269 4/22/2025 1.0.5 is deprecated because it is no longer maintained.
1.0.4 258 4/22/2025 1.0.4 is deprecated because it is no longer maintained.
1.0.3 258 4/22/2025 1.0.3 is deprecated because it is no longer maintained.
1.0.2 260 4/22/2025 1.0.2 is deprecated because it is no longer maintained.
1.0.1 260 4/22/2025 1.0.1 is deprecated because it is no longer maintained.
1.0.0 265 4/22/2025 1.0.0 is deprecated because it is no longer maintained.