Franz.Common.Mediator
2.2.7
dotnet add package Franz.Common.Mediator --version 2.2.7
NuGet\Install-Package Franz.Common.Mediator -Version 2.2.7
<PackageReference Include="Franz.Common.Mediator" Version="2.2.7" />
<PackageVersion Include="Franz.Common.Mediator" Version="2.2.7" />
<PackageReference Include="Franz.Common.Mediator" />
paket add Franz.Common.Mediator --version 2.2.7
#r "nuget: Franz.Common.Mediator, 2.2.7"
#:package Franz.Common.Mediator@2.2.7
#addin nuget:?package=Franz.Common.Mediator&version=2.2.7
#tool nuget:?package=Franz.Common.Mediator&version=2.2.7
📦 Franz.Common.Mediator (v2.2.7)
A deterministic execution engine for application commands, queries, notifications, and events within the Franz Framework.
This mediator is designed as a structured execution pipeline runtime, not a simple in-process dispatcher.
It provides:
- explicit handler execution
- composable pipeline stages
- deterministic cross-cutting behavior
- clear separation between command/query/event execution flows
✨ Features
Core Dispatcher
IDispatcheras the single entry point for execution- Scoped execution model per request
- Explicit handler resolution via DI
Handler Model
Supports:
ICommandHandler<TCommand, TResult>IQueryHandler<TQuery, TResult>INotificationHandler<TEvent>IEventHandler<TEvent>IStreamQueryHandler<TQuery, TStream>
Handlers are discovered via assembly scanning and registered automatically.
Pipeline Execution Engine
The mediator supports composable execution pipelines:
Command / Query Pipelines
IPipeline<TRequest, TResult>- Pre-processing + post-processing stages
- Ordered execution chain
Event Pipelines
IEventPipeline<TEvent>- Dedicated event execution flow
- Independent from command/query pipelines
Cross-Cutting Pipelines (Composable Modules)
Franz Mediator provides optional pipeline modules:
Observability
- Logging pipelines
- Serilog enrichment pipelines
- Console observer (optional)
Validation
- Request validation pipeline
- Event validation pipeline
- Pre-execution validation hooks
Resilience
- Retry pipeline
- Circuit breaker pipeline
- Bulkhead isolation pipeline
- Timeout pipeline
Transactional Control
- Transaction pipeline for execution boundaries
🧭 Execution Model
The Franz Mediator follows a strict execution flow:
Dispatcher
↓
Pre-Pipeline Stages
↓
Handler Execution
↓
Post-Pipeline Stages
↓
Observers (optional)
For events:
Dispatcher
↓
Event Pre-Pipeline
↓
Event Handlers
↓
Event Post-Pipeline
📐 Design Principles
1. Deterministic Execution
Pipeline execution order is explicit and predictable.
2. Composable Behavior
Cross-cutting concerns are modular pipeline components.
3. No Hidden Magic
No implicit behavior chains outside registered pipelines.
4. Clear Execution Boundaries
Commands, queries, and events are distinct execution models.
5. DI-Native Design
All behavior is composed through IServiceCollection.
⚙️ Basic Usage
1️⃣ Register Mediator
services.AddFranzMediator(
new[] { typeof(SomeHandler).Assembly });
2️⃣ Optional Default Setup (Recommended)
services.AddFranzMediatorDefault();
This includes:
- dispatcher
- handler scanning
- logging pipeline
- validation pipeline
- audit pipeline
- transaction pipeline (optional module set)
3️⃣ Sending Commands / Queries
var result = await dispatcher.Send(new CreateHeroCommand());
4️⃣ Publishing Notifications / Events
await dispatcher.Publish(new HeroCreatedEvent());
🧩 Pipeline Composition Model
Pipelines are additive and ordered via registration:
builder.Services.AddFranzSerilogAuditPipeline()
.AddFranzEventValidationPipeline()
.AddFranzSerilogLoggingPipeline()
.AddFranzTelemetry(env, config);
Each pipeline is:
- independently composable
- scoped
- executed in registration order
⚠️ Architectural Boundaries
This mediator:
DOES
- execute in-process application logic
- orchestrate pipelines
- manage handler lifetimes
- enforce execution policies
DOES NOT
- handle transport (Kafka, RabbitMQ, HTTP)
- manage background workers
- perform hosting or runtime orchestration outside DI
📦 Versioning — v2.2.7
✨ Added
AddFranzMediatorDefault()as canonical setup method- clearer separation between command/query/event pipelines
- improved event pipeline isolation model
🔧 Changed
- pipeline system explicitly separated into command/query/event flows
- improved DI scanning consistency for handlers
- clarified execution model semantics
🧠 Architectural Clarification
- Mediator = execution engine
- Pipelines = behavior composition layer
- Transport systems (Kafka, etc.) are external to this model
📄 License
MIT License
🧠 Final Note
Franz Mediator is designed around one principle:
Execution must be explicit, composable, and deterministic
It is not a request dispatcher with optional behaviors — it is a structured execution runtime for application logic.
| 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
- FluentValidation (>= 12.1.1)
- Franz.Common (>= 2.2.7)
- Microsoft.AspNetCore.Http (>= 2.3.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Scrutor (>= 7.0.0)
- Serilog (>= 4.3.1)
NuGet packages (12)
Showing the top 5 NuGet packages that depend on Franz.Common.Mediator:
| Package | Downloads |
|---|---|
|
Franz.Common.Business
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Bootstrap
Shared utility library for the Franz Framework. |
|
|
Franz.Common.MongoDB
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Mediator.Polly
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Http.Refit
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.7 | 512 | 6/7/2026 |
| 2.2.6 | 509 | 6/6/2026 |
| 2.2.5 | 550 | 6/4/2026 |
| 2.2.4 | 539 | 6/3/2026 |
| 2.2.3 | 525 | 6/2/2026 |
| 2.2.2 | 536 | 6/2/2026 |
| 2.2.1 | 547 | 5/24/2026 |
| 2.1.4 | 441 | 4/27/2026 |
| 2.1.3 | 422 | 4/26/2026 |
| 2.1.2 | 422 | 4/26/2026 |
| 2.1.1 | 426 | 4/22/2026 |
| 2.0.2 | 443 | 3/30/2026 |
| 2.0.1 | 435 | 3/29/2026 |
| 1.7.8 | 442 | 3/2/2026 |
| 1.7.7 | 470 | 1/31/2026 |
| 1.7.6 | 465 | 1/22/2026 |
| 1.7.5 | 437 | 1/10/2026 |
| 1.7.4 | 458 | 12/27/2025 |
| 1.7.3 | 524 | 12/22/2025 |
| 1.7.2 | 529 | 12/21/2025 |