Chapar.Zamin.Outbox 0.1.0

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

🐎 Chapar

Ask DeepWiki

Chapar is a clean, extensible, and business‑friendly messaging abstraction for .NET. It hides the complexity of RabbitMQ and MassTransit behind a minimal API, while providing out‑of‑the‑box support for the Outbox, Inbox, and Pipeline patterns.

Inspired by the ancient Persian courier system – fast, reliable, and invisible to the message sender.

Why Chapar?

  • Zero ceremony: PublishAsync and SendAsync are all you need.
  • Transparent Outbox / Inbox: Add one NuGet package and every message is automatically stored in the database before delivery. No code changes.
  • Pipeline: a chain of configurable behaviours (logging, error handling, validation, …) that wrap every handler.
  • Framework agnostic: works standalone or on top of Zamin.
  • Transport agnostic: currently uses MassTransit v8 (free & community‑supported), with Wolverine coming soon.

Packages

Package Description
Chapar (Chapar.Core) Core abstractions: IChaparBus, IMessageHandler<T>, Outbox/Inbox contracts
Chapar.MassTransit MassTransit + RabbitMQ implementation
Chapar.Pipeline Extensible message handling pipeline
Chapar.Outbox.EntityFrameworkCore EF Core‑based Outbox (transparent decorator)
Chapar.Inbox.EntityFrameworkCore EF Core‑based Inbox (idempotency filter)
Chapar.Zamin Bridges Chapar with the Zamin framework
Chapar.Zamin.MassTransit One‑line setup for Chapar + Zamin + MassTransit
Chapar.Zamin.Outbox Outbox/Inbox stores backed by Zamin's native tables

Quick start (standalone)

dotnet add package Chapar
dotnet add package Chapar.MassTransit
services.AddChaparMassTransit(opt => opt.Host = "localhost");

// Define a message
public record OrderPlaced(Guid OrderId) : IEvent;

// Publish
var bus = provider.GetRequiredService<IChaparBus>();
await bus.PublishAsync(new OrderPlaced(Guid.NewGuid()));

// Handle
public class OrderPlacedHandler : IMessageHandler<OrderPlaced>
{
    public Task HandleAsync(OrderPlaced message, CancellationToken ct)
    {
        Console.WriteLine($"Order {message.OrderId} received.");
        return Task.CompletedTask;
    }
}

EF Core Outbox

Chapar.Outbox.EntityFrameworkCore stores outgoing messages in the application's EF Core context before they are delivered by the background publisher.

By default, outbox messages are staged and committed with the caller's unit of work:

services.AddChaparOutboxEntityFramework(options =>
{
    options.DefaultSaveMode = OutboxSaveMode.Transactional;
});

await bus.PublishAsync(new OrderPlaced(orderId));
await dbContext.SaveChangesAsync(ct);

This keeps the business data and the outbox row in the same database transaction.

For messages that should be persisted after the business transaction has already completed, use the EF outbox extension overloads:

using Chapar.Outbox.EntityFrameworkCore;
using Chapar.Outbox.EntityFrameworkCore.Extensions;

await dbContext.SaveChangesAsync(ct);

await bus.PublishAsync(
    new WelcomeSmsRequested(userId),
    OutboxSaveMode.Immediate,
    cancellationToken: ct);

Immediate performs a separate SaveChangesAsync through the outbox store. Use it after committing any business changes that must not be part of the outbox transaction.

Documentation

Roadmap / Backlog

We welcome contributions! If you are interested in any of the items below, feel free to open an issue or send a pull request.

✅ Completed

Feature / Package Description
Chapar.Core Core abstractions and contracts
Chapar.MassTransit MassTransit v8 integration
Chapar.Pipeline Pipeline behaviour infrastructure (diagnostics, error handling, etc.)
Chapar.Outbox.EntityFrameworkCore Outbox store backed by EF Core
Chapar.Inbox.EntityFrameworkCore Inbox store backed by EF Core
Chapar.Zamin Zamin framework integration (replaces ISendMessageBus)
Chapar.Zamin.MassTransit One‑line setup for Chapar + Zamin + MassTransit
Chapar.Zamin.Outbox Outbox/Inbox stores backed by Zamin's native tables

🚧 In Progress (by core team)

Feature / Package Description
Chapar.RoutingSlip Content‑based routing (Courier / Routing Slip)
Chapar.Saga Saga / Process Manager (state machine) support

💡 Backlog (up for grabs – contributions welcome!)

Feature / Package Description
Chapar.Wolverine Wolverine transport adapter
Chapar.Outbox.Dapper Outbox store using Dapper
Chapar.Inbox.Dapper Inbox store using Dapper
Chapar.Outbox.InMemory In‑memory Outbox (for testing / lightweight scenarios)
Chapar.Inbox.InMemory In‑memory Inbox (for testing)
Chapar.Outbox.Redis Outbox store backed by Redis
Chapar.Inbox.Redis Inbox store backed by Redis
Chapar.RequestResponse Stronger abstractions for request/response patterns
Chapar.FluentValidation Pre‑built pipeline behaviour for FluentValidation
Chapar.Authorization Security behaviour for header/token checks
Chapar.Outbox.MongoDB Outbox store for MongoDB
Chapar.Inbox.MongoDB Inbox store for MongoDB
Management / Observability Dashboard, dead‑letter browser, metrics

License

MIT

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.

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
0.1.0 188 7/20/2026