ModulusKit.Messaging.Abstractions 3.0.0

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

Modulus.Messaging.Abstractions

Abstractions for the Modulus messaging system — IMessageBus, IIntegrationEvent, and outbox pattern interfaces.

Installation

dotnet add package ModulusKit.Messaging.Abstractions

Key Types

Integration Events

// Define an integration event
public record OrderShipped(Guid OrderId, DateTime ShippedAt)
    : IntegrationEvent;

// IntegrationEvent base class auto-generates:
//   EventId      = Guid.NewGuid()
//   OccurredOn   = DateTime.UtcNow
//   CorrelationId = null (optional, settable via init)

Message Bus

public interface IMessageBus
{
    // Publish an event to all subscribers
    Task Publish<TEvent>(TEvent @event, CancellationToken ct = default)
        where TEvent : IIntegrationEvent;
}

Integration Event Handlers

public class OrderShippedHandler : IIntegrationEventHandler<OrderShipped>
{
    public Task Handle(OrderShipped @event, CancellationToken ct)
    {
        // React to the cross-module event
        return Task.CompletedTask;
    }
}

Outbox Pattern

The IOutboxStore interface enables the transactional outbox pattern — events are stored as database rows, then published reliably by a background processor with per-row retry backoff and dead-lettering. (Whether the row commits in the same transaction as your business data depends on how the store is configured — see the outbox documentation for the two supported setups.)

public interface IOutboxStore
{
    Task Save(IIntegrationEvent @event, CancellationToken cancellationToken = default);

    Task<IReadOnlyList<OutboxMessage>> GetPending(int batchSize, int maxAttempts, CancellationToken cancellationToken = default);

    Task<int> CountPending(int maxAttempts, CancellationToken cancellationToken = default);

    Task MarkAsProcessed(IEnumerable<Guid> ids, CancellationToken cancellationToken = default);

    Task MarkAsFailed(Guid messageId, string error, DateTime? nextAttemptOnUtc, CancellationToken cancellationToken = default);
}

GetPending skips dead-lettered rows (Attempts >= maxAttempts) and rows whose NextAttemptOnUtc backoff has not elapsed; MarkAsFailed records the failure and the next-attempt time computed from the retry policy. The inbox counterpart, IInboxStore, provides per-handler idempotent consumption (reserve → execute → mark processed, with reservation release on dead-letter).

Learn More

See the Modulus repository for full documentation.

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

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

Package Downloads
ModulusKit.Messaging

Messaging library for .NET modular monoliths with transactional outbox/inbox, consumer retry, and an in-memory transport. RabbitMQ and Azure Service Bus transports ship as ModulusKit.Messaging.RabbitMq and ModulusKit.Messaging.AzureServiceBus.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 175 7/26/2026
3.1.0 359 7/26/2026
3.0.0 283 7/26/2026
2.1.0 145 7/4/2026
2.0.0 138 7/3/2026
1.2.5 137 3/15/2026
1.2.4 123 3/15/2026
1.2.3 117 3/14/2026
1.2.2 119 3/14/2026
1.2.1 120 3/14/2026
1.2.0 124 3/14/2026
1.1.1 131 3/8/2026
1.1.0 118 3/5/2026
1.0.1 130 3/3/2026