LiteBus 6.0.0
dotnet add package LiteBus --version 6.0.0
NuGet\Install-Package LiteBus -Version 6.0.0
<PackageReference Include="LiteBus" Version="6.0.0" />
<PackageVersion Include="LiteBus" Version="6.0.0" />
<PackageReference Include="LiteBus" />
paket add LiteBus --version 6.0.0
#r "nuget: LiteBus, 6.0.0"
#:package LiteBus@6.0.0
#addin nuget:?package=LiteBus&version=6.0.0
#tool nuget:?package=LiteBus&version=6.0.0
LiteBus
<p align="center"> <img src="assets/logo/litebus-logo.svg" alt="LiteBus logo" width="360"> </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://codecov.io/gh/litenova/LiteBus"><img src="https://codecov.io/gh/litenova/LiteBus/graph/badge.svg?token=XBNYITSV5A" alt="Code coverage"></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://www.nuget.org/packages/LiteBus"><img src="https://img.shields.io/nuget/dt/LiteBus.svg" alt="NuGet downloads"></a> <a href="https://github.com/litenova/LiteBus/releases"><img src="https://img.shields.io/github/v/release/litenova/LiteBus" alt="GitHub release"></a> <a href="https://github.com/litenova/LiteBus/blob/main/LICENSE"><img src="https://img.shields.io/github/license/litenova/LiteBus" alt="License"></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="https://litebus.io"><img src="https://img.shields.io/badge/docs-litebus.io-2f6fed" alt="Documentation"></a> </p>
LiteBus is a mediator and durable messaging library for .NET 10. Commands, queries, and events have separate contracts and pipelines. Inbox and outbox processing use explicit storage, dispatch, and ingress adapters, so an application references an external SDK only when it selects that integration.
Version 6.0.0 targets .NET 10 and introduces the current module, durable messaging, transport, and hosting model. Applications upgrading from v5 should follow the v5 to v6 migration guide, including its database replacement and data-migration guidance. See the v6 changelog for the complete release record.
Package Selection
Install the package for each application concern. The package brings its abstractions and lower-layer runtime dependencies with it.
| Concern | Package |
|---|---|
| Core mediator and durable contracts | LiteBus |
| Commands | LiteBus.Commands.Extensions.Microsoft.DependencyInjection |
| Queries | LiteBus.Queries.Extensions.Microsoft.DependencyInjection |
| Events | LiteBus.Events.Extensions.Microsoft.DependencyInjection |
| Inbox core | LiteBus.Inbox |
| Outbox core | LiteBus.Outbox |
| PostgreSQL storage | LiteBus.Inbox.Storage.PostgreSql or LiteBus.Outbox.Storage.PostgreSql |
| Entity Framework Core storage | LiteBus.Inbox.Storage.EntityFrameworkCore or LiteBus.Outbox.Storage.EntityFrameworkCore |
| In-memory storage for tests | LiteBus.Inbox.Storage.InMemory or LiteBus.Outbox.Storage.InMemory |
| In-process dispatch | LiteBus.Inbox.Dispatch.InProcess or LiteBus.Outbox.Dispatch.InProcess |
| Broker dispatch or ingress | Install the matching LiteBus.Inbox.Dispatch.*, LiteBus.Outbox.Dispatch.*, or LiteBus.Inbox.Ingress.* package |
| Broker transport | LiteBus.Transport.Amqp, LiteBus.Transport.Kafka, LiteBus.Transport.AwsSqs, or LiteBus.Transport.AzureServiceBus |
| Generic Host bridge | LiteBus.Runtime.Extensions.Microsoft.Hosting |
| OpenTelemetry registration | LiteBus.Inbox.Extensions.OpenTelemetry, LiteBus.Outbox.Extensions.OpenTelemetry, or LiteBus.Transport.Extensions.OpenTelemetry |
The Dependency Graph lists every package, its architectural layer, and its direct references.
Read the published documentation at litebus.io, browse the package and feature index, or run the Fumadocs site locally from site.
Quick Start
Install one or more semantic mediator modules:
dotnet add package LiteBus.Commands.Extensions.Microsoft.DependencyInjection
dotnet add package LiteBus.Queries.Extensions.Microsoft.DependencyInjection
dotnet add package LiteBus.Events.Extensions.Microsoft.DependencyInjection
Define a command and one 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)
{
var productId = Guid.NewGuid();
return Task.FromResult(productId);
}
}
Register the messaging and semantic features in one callback. The module registry validates the completed dependency graph, so callback order does not change build order:
builder.Services.AddLiteBus(liteBus =>
{
var applicationAssembly = typeof(Program).Assembly;
liteBus.AddMessaging(_ => { });
liteBus.AddCommands(commands =>
commands.RegisterFromAssembly(applicationAssembly));
liteBus.AddQueries(queries =>
queries.RegisterFromAssembly(applicationAssembly));
liteBus.AddEvents(events =>
events.RegisterFromAssembly(applicationAssembly));
});
Inject the mediator for the operation being performed:
var productId = await commandMediator.SendAsync(
new CreateProductCommand("Widget", 9.99m),
cancellationToken);
The Getting Started guide covers commands, queries, events, module declaration, and handler discovery.
Durable Messaging
An inbox stores a command before execution. An outbox stores an event before publication. Storage, dispatch, ingress, and hosted processing remain separate choices.
builder.Services.AddLiteBus(liteBus =>
{
liteBus.AddMessaging(_ => { });
liteBus.AddCommands(commands =>
commands.RegisterFromAssembly(typeof(Program).Assembly));
liteBus.AddInbox(inbox =>
{
inbox.Contracts.Register<CreateProductCommand>("catalog.create-product");
inbox.UseInMemoryStorage();
inbox.UseInProcessDispatch();
inbox.EnableInboxProcessor();
});
});
Use in-memory storage for tests and local behavior checks. Use the PostgreSQL or Entity Framework Core adapter when durable writes must participate in an application transaction. See Inbox, Outbox, and Transactional Messaging Writes.
Architecture
LiteBus projects follow an explicit dependency role matrix. Every shipping project is assigned one role, and architecture tests reject forbidden project edges and direct package references.
| Dependency role | Responsibility |
|---|---|
| Platform, mediation, and durable contracts | Stable abstractions without SDK or host dependencies |
| Core implementation | Default implementations and broker-neutral runtime behavior |
| Technology adapter | One persistence or broker technology |
| Feature bridge | Storage, dispatch, ingress, and cross-feature integration |
| Host adapter | Dependency injection, hosting, ASP.NET Core, diagnostics, and telemetry composition |
| Consumer tooling and aggregate | Analyzer/test support and the core-only convenience package |
The project count is intentional. Inbox and outbox remain separate, each broker and store remains opt-in, and integration SDKs do not enter unrelated dependency graphs. See Architecture for the module lifecycle and package rules.
Documentation
Repository documentation is authoritative. Start with the Documentation Index.
| Subject | Reference |
|---|---|
| Compile-checked application sample | LiteBus Sample |
| Capability and package inventory | v6 Feature Index and Capability Catalog |
| Module and dependency model | Architecture and Dependency Graph |
| Handler behavior | Handler Pipeline and Execution Context |
| Reliable messaging | Reliable Messaging Semantics |
| Operations | Production Runbook and Diagnostics and Health |
| Testing | Testing and Integration Tests |
| Upgrade work | Migration Guide v6 |
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 the PostgreSQL, AMQP, Kafka, AWS SQS emulator, Azure Service Bus emulator, and relational integration suites. The Integration Tests guide lists the CI categories and local commands.
Contributing
Read Contributing before changing public APIs, package references, module dependencies, or persisted envelope behavior.
LiteBus is licensed under the MIT License.
| 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 (>= 6.0.0)
- LiteBus.Commands.Abstractions (>= 6.0.0)
- LiteBus.DurableMessaging.Abstractions (>= 6.0.0)
- LiteBus.Events (>= 6.0.0)
- LiteBus.Events.Abstractions (>= 6.0.0)
- LiteBus.Inbox (>= 6.0.0)
- LiteBus.Inbox.Abstractions (>= 6.0.0)
- LiteBus.Messaging (>= 6.0.0)
- LiteBus.Messaging.Abstractions (>= 6.0.0)
- LiteBus.Outbox (>= 6.0.0)
- LiteBus.Outbox.Abstractions (>= 6.0.0)
- LiteBus.Queries (>= 6.0.0)
- LiteBus.Queries.Abstractions (>= 6.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on LiteBus:
| Package | Downloads |
|---|---|
|
VaultForce.Application
shared resources |
|
|
Ramsha.LocalMessaging
Modular extensible framework built on top of ASP.NET Core. |
|
|
VaultForce.Sdk
shared sdk |
|
|
ACleanAPI
ACleanAPI is a .NET library that provides a clean architecture implementation for building APIs. It offers a structured approach to organizing code, separating concerns, and promoting maintainability and testability in API development. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on LiteBus:
| Repository | Stars |
|---|---|
|
EdiWang/Moonglade
Blog system of https://edi.wang, runs on Microsoft Azure
|
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.0 | 0 | 7/18/2026 |
| 5.0.0 | 3,013 | 5/29/2026 |
| 4.4.0 | 1,557 | 5/19/2026 |
| 4.3.0 | 21,652 | 2/17/2026 |
| 4.2.0 | 35,383 | 11/11/2025 |
| 4.1.0 | 1,484 | 10/30/2025 |
| 4.0.0 | 4,033 | 9/18/2025 |
| 3.1.0 | 17,424 | 8/5/2025 |
| 3.0.0 | 9,680 | 7/21/2025 |
| 2.2.3 | 239 | 7/18/2025 |
| 2.2.2 | 222 | 7/18/2025 |
| 2.2.1 | 14,479 | 7/8/2025 |
| 2.2.0 | 279 | 7/8/2025 |
| 2.1.0 | 286 | 7/1/2025 |
| 2.0.0 | 1,752 | 4/29/2025 |
| 1.1.0 | 278 | 4/24/2025 |
| 1.0.0 | 219 | 4/19/2025 |
| 0.25.1 | 300 | 4/17/2025 |
| 0.25.0 | 299 | 4/13/2025 |