Franz.Common.Messaging.MultiTenancy 3.0.0

dotnet add package Franz.Common.Messaging.MultiTenancy --version 3.0.0
                    
NuGet\Install-Package Franz.Common.Messaging.MultiTenancy -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.MultiTenancy" 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.MultiTenancy" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Messaging.MultiTenancy" />
                    
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.MultiTenancy --version 3.0.0
                    
#r "nuget: Franz.Common.Messaging.MultiTenancy, 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.MultiTenancy@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.MultiTenancy&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Messaging.MultiTenancy&version=3.0.0
                    
Install as a Cake Tool

Franz.Common.Messaging.MultiTenancy

Validated tenant and domain execution scopes for broker-delivered messages.

Overview

The messaging integration extracts tenant/domain identifiers from message headers, resolves an active tenant, optionally validates it, authorizes the authenticated producer, and establishes a scoped TenantExecutionContext for the message handler.

Installation

dotnet add package Franz.Common.Messaging.MultiTenancy

Registration

using Franz.Common.Messaging.MultiTenancy.Extensions;

builder.Services.AddMessagingMultitenancyContext(options =>
{
    options.RequireTenantScope = true;
});

// Application-owned registrations:
builder.Services.AddScoped<ITenantStore, TenantStore>();
builder.Services.AddScoped<ITenantMessageAuthorizer, BrokerIdentityTenantMessageAuthorizer>();

The parameterless overload is also available. RequireTenantScope defaults to false because the package can be used for outbound metadata propagation without requiring every consumer to establish a tenant context.

When enabled, hosted messaging consumers validate that ITenantMessageContextInitializer is registered before they start listening. The initializer requires an ITenantStore, ITenantExecutionContextAccessor, and ITenantMessageAuthorizer. An optional ITenantValidator is also invoked when registered.

Message contract

A tenant-scoped message must contain exactly one valid, non-empty GUID value in the standard tenant header. A domain header is optional; when present it must contain exactly one valid GUID and resolve to a verified domain associated with the tenant.

The initializer rejects unknown or inactive tenants, invalid domain ownership, failed tenant validation, and unauthorized producers. The authorizer must use trusted broker/transport identity; a message header alone is not proof that the producer may publish for that tenant.

Execution lifecycle

The initializer exposes BeginAsync(message, cancellationToken), which returns an async-disposable execution scope. Keep that scope alive for the full message handler execution and dispose it afterward. Disposal clears the scoped tenant execution context.

The package also registers tenant/domain message builders so outgoing messages can propagate the current validated context. Do not reuse a DI scope or tenant accessor across separate deliveries.

  • Franz.Common.MultiTenancy: tenant contracts and execution context.
  • Franz.Common.Messaging: message and header contracts.
  • Franz.Common.Messaging.Hosting.Kafka and Franz.Common.Messaging.Hosting.RabbitMQ: hosted transport integration.

License

MIT. See the repository 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 (9)

Showing the top 5 NuGet packages that depend on Franz.Common.Messaging.MultiTenancy:

Package Downloads
Franz.Common.Messaging.Hosting

Shared utility library for the Franz Framework.

Franz.Common.Messaging.Bootstrap

Shared utility library for the Franz Framework.

Franz.Common.Messaging.MassTransit

Shared utility library for the Franz Framework.

Franz.Common.Http.Messaging

Shared utility library for the Franz Framework.

Franz.Common.Messaging.Hosting.Kafka

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 62 11/10/2026
2.3.4 479 11/1/2026
2.3.3 320 10/28/2026
2.3.2 120 10/27/2026
2.3.1 174 10/26/2026
2.3.0 193 7/21/2026
2.2.19 147 7/19/2026
2.2.18 155 7/19/2026
2.2.17 155 7/12/2026
2.2.16 250 7/2/2026
2.2.15 161 6/29/2026
2.2.14 151 6/29/2026
2.2.13 149 6/29/2026
2.2.12 148 6/28/2026
2.2.11 149 6/28/2026
2.2.10 150 6/28/2026
2.2.9 151 6/28/2026
2.2.8 156 6/28/2026
2.2.7 158 6/7/2026
2.2.6 155 6/6/2026
Loading failed