Why Excalibur?
Start with Excalibur.Dispatch for messaging. Add domain modeling, event sourcing, and sagas as you grow.
Zero-allocation message dispatching with minimal overhead. Built for high-throughput scenarios where every microsecond counts.
First-class support for event sourcing patterns. Store events, rebuild state, and maintain a complete audit trail of your domain.
Leverage C# generics and pattern matching for compile-time safety. No magic strings, no runtime surprises.
Composable middleware for cross-cutting concerns: validation, logging, retry policies, circuit breakers, and more.
Outbox pattern, leader election, OpenTelemetry integration, and health checks. Deploy with confidence.
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.
| Scenario | Packages |
|---|---|
| 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
// 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
| Feature | Excalibur | MediatR | MassTransit |
|---|---|---|---|
| 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