ModulusKit.Messaging.Abstractions
1.1.0
dotnet add package ModulusKit.Messaging.Abstractions --version 1.1.0
NuGet\Install-Package ModulusKit.Messaging.Abstractions -Version 1.1.0
<PackageReference Include="ModulusKit.Messaging.Abstractions" Version="1.1.0" />
<PackageVersion Include="ModulusKit.Messaging.Abstractions" Version="1.1.0" />
<PackageReference Include="ModulusKit.Messaging.Abstractions" />
paket add ModulusKit.Messaging.Abstractions --version 1.1.0
#r "nuget: ModulusKit.Messaging.Abstractions, 1.1.0"
#:package ModulusKit.Messaging.Abstractions@1.1.0
#addin nuget:?package=ModulusKit.Messaging.Abstractions&version=1.1.0
#tool nuget:?package=ModulusKit.Messaging.Abstractions&version=1.1.0
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;
// Send a command (routed by type name)
Task Send<TCommand>(TCommand command, CancellationToken ct = default)
where TCommand : class;
// Send a command to a specific destination
Task Send<TCommand>(TCommand command, Uri destination, CancellationToken ct = default)
where TCommand : class;
}
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 alongside your business data in the same transaction, then published reliably by a background processor.
public interface IOutboxStore
{
Task Save(IIntegrationEvent @event, CancellationToken ct = default);
Task<IReadOnlyList<OutboxMessage>> GetPending(int batchSize, CancellationToken ct = default);
Task MarkAsProcessed(IEnumerable<Guid> ids, CancellationToken ct = default);
}
Learn More
See the Modulus repository for full documentation.
| Product | Versions 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. |
-
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 MassTransit integration, supporting RabbitMQ, Azure Service Bus, and in-memory transports with transactional outbox. |
GitHub repositories
This package is not used by any popular GitHub repositories.