Franz.Common.Messaging.MultiTenancy
1.3.1
dotnet add package Franz.Common.Messaging.MultiTenancy --version 1.3.1
NuGet\Install-Package Franz.Common.Messaging.MultiTenancy -Version 1.3.1
<PackageReference Include="Franz.Common.Messaging.MultiTenancy" Version="1.3.1" />
<PackageVersion Include="Franz.Common.Messaging.MultiTenancy" Version="1.3.1" />
<PackageReference Include="Franz.Common.Messaging.MultiTenancy" />
paket add Franz.Common.Messaging.MultiTenancy --version 1.3.1
#r "nuget: Franz.Common.Messaging.MultiTenancy, 1.3.1"
#:package Franz.Common.Messaging.MultiTenancy@1.3.1
#addin nuget:?package=Franz.Common.Messaging.MultiTenancy&version=1.3.1
#tool nuget:?package=Franz.Common.Messaging.MultiTenancy&version=1.3.1
Franz.Common.Messaging.MultiTenancy
A library within the Franz Framework that adds multi-tenancy support to messaging workflows. This package provides tools for managing tenant and domain-specific messaging contexts, enabling seamless integration of multi-tenancy in distributed systems.
Features
Tenant Context Management:
TenantContextAccessor
for handling tenant-specific data in messaging workflows.
Domain Context Management:
DomainContextAccessor
for managing domain-specific information during message processing.
Resolvers:
HeaderTenantResolver
andHeaderDomainResolver
for resolving multi-tenancy metadata from message headers.MessagePropertyTenantResolver
andMessagePropertyDomainResolver
for resolving multi-tenancy metadata from message properties.
Resolution Pipelines:
DefaultTenantResolutionPipeline
andDefaultDomainResolutionPipeline
to coordinate multiple resolvers in order.
Middleware:
TenantResolutionMiddleware
andDomainResolutionMiddleware
for automatic resolution per message.
Service Registration:
ServiceCollectionExtensions
to simplify the setup of multi-tenancy messaging services.
Message Builders:
TenantMessageBuilder
andDomainMessageBuilder
for constructing messages with tenant and domain data.
Version Information
- Current Version: 1.3.1
- Part of the private Franz Framework ecosystem.
Dependencies
This package relies on:
- Franz.Common.Messaging: Provides foundational messaging utilities and abstractions.
- Franz.Common.MultiTenancy: Core utilities for tenant and domain management.
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.MultiTenancy --Version 1.3.1
Usage
1. Register Multi-Tenancy Messaging Services
Use ServiceCollectionExtensions
to register messaging multi-tenancy services:
using Franz.Common.Messaging.MultiTenancy.Extensions;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddFranzMessagingMultiTenancy();
}
}
2. Access Tenant and Domain Contexts
Leverage TenantContextAccessor
and DomainContextAccessor
to retrieve tenant and domain-specific data:
using Franz.Common.Messaging.MultiTenancy;
public class TenantService
{
private readonly ITenantContextAccessor _tenantContextAccessor;
public TenantService(ITenantContextAccessor tenantContextAccessor)
{
_tenantContextAccessor = tenantContextAccessor;
}
public Guid? GetCurrentTenantId() => _tenantContextAccessor.GetCurrentTenantId();
}
using Franz.Common.Messaging.MultiTenancy;
public class DomainService
{
private readonly IDomainContextAccessor _domainContextAccessor;
public DomainService(IDomainContextAccessor domainContextAccessor)
{
_domainContextAccessor = domainContextAccessor;
}
public Guid? GetCurrentDomainId() => _domainContextAccessor.GetCurrentDomainId();
}
3. Automatic Tenant/Domain Resolution in Messaging Pipelines
Enable middleware to resolve tenant and domain per-message:
using Franz.Common.Messaging.MultiTenancy.Middleware;
public class MessagingPipeline
{
public void Configure(IMessagePipelineBuilder pipeline)
{
pipeline.Use<TenantResolutionMiddleware>();
pipeline.Use<DomainResolutionMiddleware>();
}
}
4. Build Tenant and Domain Messages
Use TenantMessageBuilder
and DomainMessageBuilder
to create tenant and domain-aware messages:
using Franz.Common.Messaging.MultiTenancy;
var tenantMessage = new TenantMessageBuilder()
.WithTenantId(Guid.NewGuid())
.Build();
var domainMessage = new DomainMessageBuilder()
.WithDomainId(Guid.NewGuid())
.Build();
Integration with Franz Framework
The Franz.Common.Messaging.MultiTenancy package integrates seamlessly with:
- Franz.Common.Messaging: Provides core messaging abstractions.
- Franz.Common.MultiTenancy: Extends tenant and domain management capabilities into messaging workflows.
- Franz.Common.Http.MultiTenancy: Aligns messaging and HTTP multi-tenancy under the same abstractions and contracts.
Contributing
This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:
- Clone the repository. @ https://github.com/bestacio89/Franz.Common/
- Create a feature branch.
- 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
TenantContextAccessor
andDomainContextAccessor
for managing tenant and domain contexts. - Introduced
TenantMessageBuilder
andDomainMessageBuilder
for constructing tenant and domain-aware messages. - Integrated
ServiceCollectionExtensions
for streamlined multi-tenancy messaging setup.
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.3.1
Expanded messaging multi-tenancy abstractions to align with HTTP and core multi-tenancy:
- Added
HeaderTenantResolver
andHeaderDomainResolver
. - Added
MessagePropertyTenantResolver
andMessagePropertyDomainResolver
. - Introduced
DefaultTenantResolutionPipeline
andDefaultDomainResolutionPipeline
to orchestrate resolvers. - Added
TenantResolutionMiddleware
andDomainResolutionMiddleware
for automatic resolution in messaging pipelines.
- Added
Enhanced
TenantContextAccessor
andDomainContextAccessor
to fully implement the updated core contracts (GetCurrentTenantId
,SetCurrentTenantId
, etc.).Extended
Message
with aProperties
dictionary for application-level metadata.Added
MessagePropertiesExtensions
for strongly-typed property access.Improved service registration via
AddFranzMessagingMultiTenancy
.
Would you like me to also prepare a NuGet-style release notes snippet for version 1.3.1
(short, consumer-facing highlights) so you can publish it with your private feed alongside the README?
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Franz.Common.Headers (>= 1.3.1)
- Franz.Common.Messaging (>= 1.3.1)
- Franz.Common.MultiTenancy (>= 1.3.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Franz.Common.Messaging.MultiTenancy:
Package | Downloads |
---|---|
Franz.Common.Messaging.Bootstrap
Shared utility library for the Franz Framework. |
|
Franz.Common.Http.Messaging
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.