ModulusKit.Messaging 1.1.0

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

Modulus.Messaging

Messaging library for .NET modular monoliths with MassTransit integration, supporting RabbitMQ, Azure Service Bus, and in-memory transports with a transactional outbox.

Installation

dotnet add package ModulusKit.Messaging

Setup

services.AddModulusMessaging(options =>
{
    options.Transport = Transport.InMemory;
    options.Assemblies.Add(typeof(Program).Assembly);
});

Transport Configuration

// RabbitMQ
services.AddModulusMessaging(options =>
{
    options.Transport = Transport.RabbitMq;
    options.ConnectionString = "amqp://guest:guest@localhost:5672";
    options.Assemblies.Add(typeof(Program).Assembly);
});

// Azure Service Bus
services.AddModulusMessaging(options =>
{
    options.Transport = Transport.AzureServiceBus;
    options.ConnectionString = "Endpoint=sb://...";
    options.Assemblies.Add(typeof(Program).Assembly);
});

Outbox Options

services.AddModulusMessaging(options =>
{
    options.Transport = Transport.RabbitMq;
    options.ConnectionString = "amqp://...";
    options.OutboxPollInterval = TimeSpan.FromSeconds(5); // default
    options.OutboxBatchSize = 100;                        // default
    options.Assemblies.Add(typeof(Program).Assembly);
});

Publishing Events

public record OrderShipped(Guid OrderId, DateTime ShippedAt)
    : IntegrationEvent;

// Publish directly via the message bus
await messageBus.Publish(new OrderShipped(orderId, DateTime.UtcNow));

// Or store in the outbox for reliable delivery
await outboxStore.Save(new OrderShipped(orderId, DateTime.UtcNow));

When using the outbox, events are stored in your database within the same transaction as your business data. A background OutboxProcessor polls for pending messages and publishes them via MassTransit.

Handling Events

public class OrderShippedHandler : IIntegrationEventHandler<OrderShipped>
{
    public async Task Handle(OrderShipped @event, CancellationToken ct)
    {
        // Handle the cross-module event
    }
}

Handlers are auto-discovered from the assemblies you provide in MessagingOptions.Assemblies and registered as scoped services.

Switching Transports

To switch from in-memory to RabbitMQ or Azure Service Bus, change the Transport property and provide a connection string. No code changes are needed in your handlers or publishers — the transport is fully abstracted.

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.

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.2.5 115 3/15/2026
1.2.4 100 3/15/2026
1.2.3 99 3/14/2026
1.2.2 103 3/14/2026
1.2.1 98 3/14/2026
1.2.0 110 3/14/2026
1.1.1 101 3/8/2026
1.1.0 98 3/5/2026
1.0.1 107 3/3/2026