Skip to main content
Open Source .NET Framework

Excalibur + Dispatch

High-performance .NET messaging, event sourcing, and CQRS — one framework, pick your packages

Why Excalibur?

Start with Excalibur.Dispatch for messaging. Add domain modeling, event sourcing, and sagas as you grow.

Blazing Fast Messaging

Zero-allocation message dispatching with minimal overhead. Built for high-throughput scenarios where every microsecond counts.

Event Sourcing Built-in

First-class support for event sourcing patterns. Store events, rebuild state, and maintain a complete audit trail of your domain.

Type-Safe by Design

Leverage C# generics and pattern matching for compile-time safety. No magic strings, no runtime surprises.

Middleware Pipeline

Composable middleware for cross-cutting concerns: validation, logging, retry policies, circuit breakers, and more.

Production Ready

Outbox pattern, leader election, OpenTelemetry integration, and health checks. Deploy with confidence.

Drop-in MediatR Replacement

Familiar patterns with enhanced capabilities. Migrate gradually with our compatibility layer.

Which Packages Do You Need?

Install only what your application requires. Every package is optional.

ScenarioPackages
Simple messaging (MediatR replacement)Excalibur.Dispatch + Excalibur.Dispatch.Abstractions
Add transport (Kafka, RabbitMQ, etc.)+ Excalibur.Dispatch.Transport.*
Domain modeling (aggregates, entities)+ Excalibur.Domain
Event sourcing with persistence+ Excalibur.EventSourcing + Excalibur.EventSourcing.SqlServer
Full CQRS/hosting with compliance+ Excalibur.Hosting.Web

Quick Start

Get up and running in minutes

Install the messaging core

dotnet add package Excalibur.Dispatch
dotnet add package Excalibur.Dispatch.Abstractions

Add packages as your architecture grows

dotnet add package Excalibur.Domain
dotnet add package Excalibur.EventSourcing
dotnet add package Excalibur.Hosting.Web

Write your first handler

Program.cs
// 1. Define your command
public record CreateOrder(string CustomerId, decimal Amount) : IDispatchAction;

// 2. Create a handler
public class CreateOrderHandler : IActionHandler<CreateOrder>
{
public async Task HandleAsync(
CreateOrder command,
CancellationToken ct)
{
// Your business logic here
await _repository.CreateAsync(new Order(command.CustomerId, command.Amount));
}
}

// 3. Register and dispatch
builder.Services.AddDispatch()
.AddHandlers(h => h.DiscoverFromEntryAssembly());

// 4. Dispatch your command
await dispatcher.DispatchAsync(new CreateOrder("cust-123", 99.99m));

How It Compares

Built for performance without sacrificing developer experience

FeatureExcaliburMediatRMassTransit
Zero-allocation dispatch
Event sourcing✅ Built-in
Outbox pattern✅ Built-in
OpenTelemetry
Type-safe middleware⚠️ Limited
Serverless support⚠️ Limited

Ready to Get Started?

Join developers building fast, reliable .NET applications with Excalibur