Why Excalibur?
Start with Excalibur.Dispatch for messaging. Add domain modeling, event sourcing, and sagas as you grow.
Map an action straight to an endpoint with app.DispatchPostAction<TRequest, TAction, TResponse>(route). The framework turns the result into the correct HTTP status — 200 on success, 400/403/500 on failure — so there is no manual result-unwrapping. The differentiator over a hand-rolled MapPost + dispatch + branch.
Authorize with native ASP.NET Core [Authorize] via a standard AuthorizationHandler<GrantsAuthorizationRequirement>. Grants flow to a pluggable policy engine (Cedar or OPA) and fail closed — any evaluation fault denies the request.
Message dispatching with configurable middleware and a measured 96 B per command. Latency depends on your handler, pipeline and runtime; the measured figures and their conditions are published in the performance docs.
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?
194 packages across 46 families — install only what your application requires. Every package beyond Excalibur.Dispatch is optional. The Package Matrix lists all of them by category.
| 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
# For the app.DispatchPostAction HTTP-endpoint helper:
dotnet add package Excalibur.Dispatch.Hosting.AspNetCore
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 an action and its handler
public record GreetAction(string Name) : IDispatchAction<string>;
public class GreetHandler : IActionHandler<GreetAction, string>
{
public Task<string> HandleAsync(GreetAction action, CancellationToken ct)
=> Task.FromResult($"Hello, {action.Name}!");
}
// 2. Register Dispatch — handlers are auto-discovered
builder.Services.AddDispatch();
var app = builder.Build();
// 3. Map the action to an HTTP endpoint. The result becomes the correct
// HTTP status automatically — 200 on success, 400/403/500 on failure.
app.DispatchPostAction<GreetRequest, GreetAction, string>(
"/greet",
(request, _) => new GreetAction(request.Name));
public record GreetRequest(string Name);
Measured Performance
Each figure below carries the date and conditions it was measured under. The comparison against other libraries is mid-refresh, so these numbers do not rank the current source against competitors — follow the link for the full method and how to reproduce them.
Ready to Get Started?
Build your first handler in under five minutes — one package, no database and no message broker required.
Coming from something else? MediatR · MassTransit · NServiceBus