PouryaKit.Messaging 0.1.0-preview.2

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

PouryaKit.Messaging

NuGet .NET 10 License: MIT

PouryaKit.Messaging

The contracts Feature code uses to react after a commit and to tell other Modules what happened. A Notification Handler reacts to a Domain Event once the change is committed, an Integration Event Handler applies what another Module published, and a Snapshot mapper turns an aggregate into the copy other Modules keep. This package holds no transport: PouryaKit.Messaging.Wolverine delivers them.

Install

dotnet add package PouryaKit.Messaging --prerelease

When to use it

  • Something must happen after a change commits and could not be taken back: send a mail, push to a browser, call another system.
  • Another Module reacts to what happened in this one.
  • A Module keeps a copy of another Module's data.
  • You give a message a stable name, or add a new version of it.

Feature code references this package alone. The Composition Root and the Host use PouryaKit.Messaging.Wolverine and PouryaKit.Messaging.Wolverine.EFCore.

Quick start

A Notification Handler publishes an Integration Event once the product is committed, as the Proving Sample does:

internal sealed class PublishProductCreatedNotificationHandler(IIntegrationEventPublisher events)
    : INotificationHandler<ProductCreatedDomainEvent>
{
    public Task<Result> Handle(
        ProductCreatedDomainEvent domainEvent,
        CancellationToken cancellationToken
    )
    {
        events.Publish(
            domainEvent.Id,
            new ProductCreatedV1(
                domainEvent.Id,
                domainEvent.OccurredOn,
                domainEvent.ProductId.Value,
                domainEvent.Name
            )
        );
        return Task.FromResult(Result.Success());
    }
}

Another Module applies it in an Integration Event Handler, writing only the effect:

internal sealed class OpenStockItemIntegrationEventHandler(
    IRepository<StockItem, StockItemId> stockItems,
    OperationContext context
) : IIntegrationEventHandler<ProductCreatedV1>
{
    public async Task<Result> Handle(
        ProductCreatedV1 integrationEvent,
        CancellationToken cancellationToken
    )
    {
        await stockItems.AddAsync(
            StockItem.Open(integrationEvent.ProductId, integrationEvent.OccurredOn, context.Tenant),
            cancellationToken
        );
        return Result.Success();
    }
}

What you get

  • Three kinds of reaction, kept distinct, each with its own contract.
  • Handlers that write only the effect: the Kit records the Receipt, commits and acknowledges.
  • A Snapshot mapper that says what other Modules see of an aggregate, and its Tombstone.
  • Declared wire and subscription names that stay stable when a class is renamed.

An outside effect happens at least once. The Receipt makes an effect in the Module's database apply once; an email, a push or a call to another system cannot roll back with it, so do the outside effect last.

Learn more

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 (1)

Showing the top 1 NuGet packages that depend on PouryaKit.Messaging:

Package Downloads
PouryaKit.Messaging.Wolverine

Durable deliveries on Wolverine with the message store in PostgreSQL: Notifications, Integration Events, Snapshots, delayed and recurring commands, each retried on its own.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 99 11/1/2026
0.1.0-preview.1 105 10/31/2026
0.1.0-preview.0.28 100 10/26/2026