Franz.Common.Messaging.Hosting.Mediator 2.3.3

dotnet add package Franz.Common.Messaging.Hosting.Mediator --version 2.3.3
                    
NuGet\Install-Package Franz.Common.Messaging.Hosting.Mediator -Version 2.3.3
                    
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="2.3.3" />
                    
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="2.3.3" />
                    
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 2.3.3
                    
#r "nuget: Franz.Common.Messaging.Hosting.Mediator, 2.3.3"
                    
#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@2.3.3
                    
#: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=2.3.3
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Messaging.Hosting.Mediator&version=2.3.3
                    
Install as a Cake Tool

Franz.Common.Messaging.Hosting.MediatR

Messaging and distributed integration for the Franz.Common framework on .NET 10.

Overview

The Franz.Common.Messaging.Hosting.MediatR package provides messaging and distributed integration within Franz.Common. It is designed to compose with the rest of the framework rather than imposing unrelated infrastructure choices on every application.

Installation

dotnet add package Franz.Common.Messaging.Hosting.MediatR

Design principles

  • Explicit composition: register only the capabilities the application needs.
  • Clear boundaries: keep domain and application contracts independent from provider-specific infrastructure where the package's role permits it.
  • Predictable behavior: make configuration, failure modes, and lifecycle ownership visible rather than relying on hidden conventions.
  • Operational readiness: validate security, resilience, diagnostics, and compatibility for the actual deployment environment.

Usage and configuration

Follow the package-specific setup, configuration, and code examples below. Only configure external services when this package requires them, and keep secrets outside source control.

Package-specific guide

An extension library within the Franz Framework that integrates MediatR with hosted messaging services. This package provides support for dispatching messages using MediatR pipelines within hosted services, enabling clean, decoupled, and testable messaging workflows.


Features

  • MediatR Integration:
    • Leverages MediatR for handling messaging strategies and execution.
  • Hosted Messaging Service Support:
    • Extends the Franz.Common.Messaging.Hosting package to include MediatR-based message processing.
  • JSON Serialization:
    • Supports Newtonsoft.Json for handling message payloads during MediatR operations.

Version Information

Current Version: v2.3.3

  • Part of the private Franz Framework ecosystem.

Dependencies

This package relies on:

  • MediatR (12.2.0): Provides in-process messaging with pipelines.
  • Newtonsoft.Json (13.0.3): Facilitates JSON serialization for message payloads.
  • Franz.Common.Messaging.Hosting: Adds hosting support for messaging workflows.

Installation

From Private Azure Feed

Since this package is hosted privately, configure your NuGet client:

dotnet nuget add source "https://your-private-feed-url" \
  --name "AzurePrivateFeed" \
  --username "YourAzureUsername" \
  --password "YourAzurePassword" \
  --store-password-in-clear-text

Install the package:

dotnet add package Franz.Common.Messaging.Hosting.MediatR  

Usage

1. Configure MediatR for Hosted Messaging

Use the MessagingStrategyExecuter class to implement MediatR pipelines in hosted messaging workflows:

using Franz.Common.Messaging.Hosting.MediatR;

public class MyMessagingStrategyExecuter : IMessagingStrategyExecuter
{
    private readonly IMediator _mediator;

    public MyMessagingStrategyExecuter(IMediator mediator)
    {
        _mediator = mediator;
    }

    public async Task ExecuteAsync(MessageContext context)
    {
        // Dispatch the message using MediatR
        await _mediator.Send(new MyMessageCommand { Payload = context.Message });
    }
}

2. Register MediatR Services

Add MediatR and messaging services in the Startup class:

using Franz.Common.Messaging.Hosting.MediatR;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMediatR(typeof(MyMessageHandler).Assembly);
        services.AddMessagingWithMediatR();
    }
}

3. Implement MediatR Handlers

Define message handlers using MediatR's IRequestHandler:

using MediatR;

public class MyMessageCommand : IRequest
{
    public string Payload { get; set; }
}

public class MyMessageHandler : IRequestHandler<MyMessageCommand>
{
    public Task<Unit> Handle(MyMessageCommand request, CancellationToken cancellationToken)
    {
        // Handle the message
        Console.WriteLine($"Processing message: {request.Payload}");
        return Unit.Task;
    }
}

Integration with Franz Framework

The Franz.Common.Messaging.Hosting.MediatR package integrates seamlessly with:

  • Franz.Common.Messaging.Hosting: Provides hosted services for messaging workflows.
  • MediatR: Enables in-process messaging and pipelines.
  • Newtonsoft.Json: Supports serialization of message payloads.

Contributing

This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:

  1. Clone the repository. @ https://github.com/bestacio89/Franz.Common/
  2. Create a feature branch.
  3. Submit a pull request for review.

License

This library is licensed under the MIT License. See the LICENSE file for more details.


Changelog

Version 1.2.65

  • Added MessagingStrategyExecuter for integrating MediatR pipelines into messaging workflows.
  • Introduced support for JSON serialization using Newtonsoft.Json.
  • Full compatibility with Franz.Common.Messaging.Hosting.

Version 1.3

  • Upgraded to .NET 9.0.8
  • Added new features and improvements
  • Separated business concepts from mediator concepts
  • Now compatible with both the in-house mediator and MediatR

Version 1.6.20

  • Updated to .NET 10.0

Dependency maintenance — October 2026

This project's dependency references were reviewed and updated as part of the repository-wide .NET 10 maintenance pass. The intended target framework and public API remain unchanged. Verify the resolved direct and transitive dependency graph through the repository's dependency validation workflow before publishing. See the central dependency upgrade record.

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
2.3.3 39 10/28/2026
2.3.2 44 10/27/2026
2.3.1 145 10/26/2026
2.3.0 174 7/21/2026
2.2.19 134 7/19/2026
2.2.18 136 7/19/2026
2.2.17 140 7/12/2026
2.2.16 275 7/2/2026
2.2.15 134 6/29/2026
2.2.14 139 6/29/2026
2.2.13 143 6/29/2026
2.2.12 135 6/28/2026
2.2.11 144 6/28/2026
2.2.10 136 6/28/2026
2.2.9 147 6/28/2026
2.2.8 138 6/28/2026
2.2.7 141 6/7/2026
2.2.6 142 6/6/2026
2.2.5 156 6/4/2026
2.2.4 149 6/3/2026
Loading failed