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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Franz.Common.Messaging.Hosting.Mediator" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Messaging.Hosting.Mediator" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Messaging.Hosting.Mediator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Franz.Common.Messaging.Hosting.Mediator --version 3.0.0
                    
#r "nuget: Franz.Common.Messaging.Hosting.Mediator, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Franz.Common.Messaging.Hosting.Mediator@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Franz.Common.Messaging.Hosting.Mediator&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Messaging.Hosting.Mediator&version=3.0.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed