Franz.Common.Messaging.Hosting.Mediator
3.0.0
dotnet add package Franz.Common.Messaging.Hosting.Mediator --version 3.0.0
NuGet\Install-Package Franz.Common.Messaging.Hosting.Mediator -Version 3.0.0
<PackageReference Include="Franz.Common.Messaging.Hosting.Mediator" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Messaging.Hosting.Mediator" Version="3.0.0" />
<PackageReference Include="Franz.Common.Messaging.Hosting.Mediator" />
paket add Franz.Common.Messaging.Hosting.Mediator --version 3.0.0
#r "nuget: Franz.Common.Messaging.Hosting.Mediator, 3.0.0"
#:package Franz.Common.Messaging.Hosting.Mediator@3.0.0
#addin nuget:?package=Franz.Common.Messaging.Hosting.Mediator&version=3.0.0
#tool nuget:?package=Franz.Common.Messaging.Hosting.Mediator&version=3.0.0
Franz.Common.Messaging.Hosting.MediatR
A hosted-messaging strategy executor that deserializes message envelopes and dispatches commands, queries, or integration events through the Franz dispatcher.
Overview
A hosted-messaging strategy executor that deserializes message envelopes and dispatches commands, queries, or integration events through the Franz dispatcher.
Installation
dotnet add package Franz.Common.Messaging.Hosting.MediatR
What the package actually integrates
Despite the historical package name and older README examples, the current MessagingStrategyExecuter uses Franz.Common.Mediator.Dispatchers.IDispatcher. It does not use MediatR's IMediator or IRequestHandler APIs in the implementation shown.
The executor implements IMessagingStrategyExecuter from the Franz messaging-hosting contracts. Its CanExecuteAsync method returns true when the message headers contain the messaging class-name metadata.
Dispatch behavior
The executor reads the class name from the message headers, resolves it with Type.GetType, deserializes the message body with Newtonsoft.Json, and dispatches according to the resulting runtime type:
| Runtime type | Dispatch operation |
|---|---|
IIntegrationEvent |
IDispatcher.PublishNotificationAsync |
ICommand |
IDispatcher.SendAsync |
IQuery<object> |
IDispatcher.SendAsync |
| Any other type | Throws TechnicalException |
The package's IIntegrationEvent contract extends the Franz mediator ICommand contract. The executor checks integration events before commands so that they are published as notifications.
Message envelope requirements
The message must contain:
- A class-name header resolvable by the running process.
- A non-null JSON body compatible with the resolved type.
Missing bodies, unresolved types, failed deserialization, and unsupported message types produce TechnicalException. The executor runs the configured IAsyncMessageActionFilter chain around dispatch and propagates the captured base exception after the filter pipeline completes.
Trust boundary
The class name is resolved dynamically from message metadata and the body is deserialized into that runtime type. Only process messages from trusted producers and enforce broker-level authentication/authorization, schema governance, and payload validation. Do not accept arbitrary externally supplied type names as safe dispatch instructions.
Concurrency and lifecycle caveat
The current implementation stores an IEnumerator<IAsyncMessageActionFilter> and per-message execution contexts as instance fields. It does not recreate the filter enumerator for each message. Do not register or share this executor as a concurrent singleton without addressing that lifecycle behavior; verify the hosting registration lifetime and concurrent-consumption model.
Registration
This project contains the strategy implementation; it does not expose the historical AddMessagingWithMediatR() registration extension described by the previous guide. Register the executor through the hosting strategy mechanism supported by the current messaging-hosting package.
License
MIT. See 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
- Franz.Common.Messaging.Hosting (>= 3.0.0)
- Franz.Common.Messaging.Hosting.RabbitMQ (>= 3.0.0)
- Newtonsoft.Json (>= 13.0.4)
- SharpCompress (>= 0.50.7)
- Snappier (>= 1.3.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Franz.Common.Messaging.Hosting.Mediator:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.Bootstrap
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 82 | 11/10/2026 |
| 2.3.4 | 358 | 11/1/2026 |
| 2.3.3 | 315 | 10/28/2026 |
| 2.3.2 | 110 | 10/27/2026 |
| 2.3.1 | 165 | 10/26/2026 |
| 2.3.0 | 183 | 7/21/2026 |
| 2.2.19 | 138 | 7/19/2026 |
| 2.2.18 | 141 | 7/19/2026 |
| 2.2.17 | 146 | 7/12/2026 |
| 2.2.16 | 280 | 7/2/2026 |
| 2.2.15 | 138 | 6/29/2026 |
| 2.2.14 | 144 | 6/29/2026 |
| 2.2.13 | 148 | 6/29/2026 |
| 2.2.12 | 140 | 6/28/2026 |
| 2.2.11 | 149 | 6/28/2026 |
| 2.2.10 | 141 | 6/28/2026 |
| 2.2.9 | 152 | 6/28/2026 |
| 2.2.8 | 143 | 6/28/2026 |
| 2.2.7 | 147 | 6/7/2026 |
| 2.2.6 | 146 | 6/6/2026 |