LiteBus.Commands
6.0.1
dotnet add package LiteBus.Commands --version 6.0.1
NuGet\Install-Package LiteBus.Commands -Version 6.0.1
<PackageReference Include="LiteBus.Commands" Version="6.0.1" />
<PackageVersion Include="LiteBus.Commands" Version="6.0.1" />
<PackageReference Include="LiteBus.Commands" />
paket add LiteBus.Commands --version 6.0.1
#r "nuget: LiteBus.Commands, 6.0.1"
#:package LiteBus.Commands@6.0.1
#addin nuget:?package=LiteBus.Commands&version=6.0.1
#tool nuget:?package=LiteBus.Commands&version=6.0.1
LiteBus
<p align="center"> <img src="assets/logo/litebus-logo.svg" alt="LiteBus logo" width="300"> </p>
<p align="center"> <a href="https://github.com/litenova/LiteBus/actions/workflows/build-and-test.yml"><img src="https://github.com/litenova/LiteBus/actions/workflows/build-and-test.yml/badge.svg" alt="Build and test status"></a> <a href="https://www.nuget.org/packages/LiteBus"><img src="https://img.shields.io/nuget/v/LiteBus.svg" alt="NuGet version"></a> <a href="https://dotnet.microsoft.com/download/dotnet/10.0"><img src="https://img.shields.io/badge/.NET-10.0-512BD4" alt=".NET 10"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/litenova/LiteBus" alt="MIT license"></a> </p>
LiteBus provides command, query, and event mediation for .NET 10 applications using CQS and DDD. Durable modules add inbox, outbox, saga, storage, dispatch, ingress, hosting, and operational APIs without requiring unrelated broker or database SDKs.
LiteBus is open source under the MIT license, free for commercial use, and will remain free.
What LiteBus Includes
- Separate command, query, and event contracts, mediators, handlers, and pipelines.
- Handler priorities, filters, pre-handlers, post-handlers, and error handlers.
- Durable inbox processing for commands and transactional outbox processing for events.
- Saga state with correlation, tenancy, optimistic concurrency, and duplicate dispatch suppression.
- Opt-in PostgreSQL, Entity Framework Core, in-memory, AMQP, Kafka, AWS SQS, and Azure Service Bus adapters.
- Generic Host integration, health checks, diagnostics, management endpoints, and OpenTelemetry registration.
Quick Start
Install the command module for Microsoft dependency injection:
dotnet add package LiteBus.Commands.Extensions.Microsoft.DependencyInjection
Define a command and handler:
public sealed record CreateProductCommand(string Name, decimal Price) : ICommand<Guid>;
public sealed class CreateProductCommandHandler : ICommandHandler<CreateProductCommand, Guid>
{
public Task<Guid> HandleAsync(
CreateProductCommand command,
CancellationToken cancellationToken)
{
return Task.FromResult(Guid.NewGuid());
}
}
Register messaging and command handlers:
builder.Services.AddLiteBus(liteBus =>
{
liteBus.AddMessaging(_ => { });
liteBus.AddCommands(commands =>
commands.RegisterFromAssembly(typeof(Program).Assembly));
});
Inject ICommandMediator and send the command:
var productId = await commandMediator.SendAsync(
new CreateProductCommand("Widget", 9.99m),
cancellationToken);
The Getting Started guide covers commands, queries, events, module registration, and handler discovery.
Durable Messaging
The inbox persists commands before execution. The outbox persists events before publication. Saga storage tracks correlated workflow state. Each axis selects its storage, dispatch, ingress, and processor modules explicitly.
Use in-memory adapters for tests. Use PostgreSQL or Entity Framework Core when message writes must participate in an application transaction. Broker integrations remain separate packages so applications install only the SDKs they use.
See Reliable Messaging, Transactional Messaging Writes, and Package Selection.
Documentation
- Documentation Index
- Feature and Package Index
- Architecture and Module Model
- Operations
- Testing
- Migration Guide
Build and Test
dotnet restore LiteBus.slnx
dotnet build LiteBus.slnx --configuration Release --no-restore
dotnet test LiteBus.slnx --configuration Release --no-build
pwsh ./scripts/Test-Documentation.ps1
Docker is required for integration suites that exercise PostgreSQL, AMQP, Kafka, AWS SQS, and Azure Service Bus emulators.
Project Policy
| 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
- LiteBus.Commands.Abstractions (>= 6.0.1)
- LiteBus.Messaging (>= 6.0.1)
- LiteBus.Runtime.Abstractions (>= 6.0.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on LiteBus.Commands:
| Package | Downloads |
|---|---|
|
LiteBus.Commands.Extensions.Microsoft.DependencyInjection
Host-framework composition APIs for the LiteBus.Commands.Extensions.Microsoft.DependencyInjection package. |
|
|
LiteBus
Mediator and durable messaging contracts for explicit command, query, event, inbox, and outbox composition in .NET applications. |
|
|
LiteBus.Commands.Extensions.MicrosoftDependencyInjection
LiteBus is a lightweight, flexible in-process mediator for implementing Command Query Separation (CQS) patterns in .NET applications. |
|
|
Ramsha.LocalMessaging
Modular extensible framework built on top of ASP.NET Core. |
|
|
LiteBus.Commands.Extensions.Autofac
Host-framework composition APIs for the LiteBus.Commands.Extensions.Autofac package. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.1 | 0 | 7/20/2026 |
| 6.0.0 | 112 | 7/18/2026 |
| 5.0.0 | 13,060 | 5/29/2026 |
| 4.4.0 | 10,934 | 5/19/2026 |
| 4.3.0 | 70,058 | 2/17/2026 |
| 4.2.0 | 72,769 | 11/11/2025 |
| 4.1.0 | 2,285 | 10/30/2025 |
| 4.0.0 | 7,745 | 9/18/2025 |
| 3.1.0 | 34,796 | 8/5/2025 |
| 3.0.0 | 9,988 | 7/21/2025 |
| 2.2.3 | 3,177 | 7/18/2025 |
| 2.2.2 | 256 | 7/18/2025 |
| 2.2.1 | 14,774 | 7/8/2025 |
| 2.2.0 | 314 | 7/8/2025 |
| 2.1.0 | 383 | 7/1/2025 |
| 2.0.0 | 4,166 | 4/29/2025 |
| 1.1.0 | 344 | 4/24/2025 |
| 1.0.0 | 258 | 4/19/2025 |
| 0.25.1 | 332 | 4/17/2025 |