VOOZH about

URL: https://www.nuget.org/packages/Franz.Common.Messaging.Hosting.RabbitMQ/

⇱ NuGet Gallery | Franz.Common.Messaging.Hosting.RabbitMQ 2.2.7




Franz.Common.Messaging.Hosting.RabbitMQ 2.2.7

dotnet add package Franz.Common.Messaging.Hosting.RabbitMQ --version 2.2.7
 
 
NuGet\Install-Package Franz.Common.Messaging.Hosting.RabbitMQ -Version 2.2.7
 
 
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.RabbitMQ" Version="2.2.7" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Messaging.Hosting.RabbitMQ" Version="2.2.7" />
 
Directory.Packages.props
<PackageReference Include="Franz.Common.Messaging.Hosting.RabbitMQ" />
 
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.RabbitMQ --version 2.2.7
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Franz.Common.Messaging.Hosting.RabbitMQ, 2.2.7"
 
 
#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.RabbitMQ@2.2.7
 
 
#: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.RabbitMQ&version=2.2.7
 
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Messaging.Hosting.RabbitMQ&version=2.2.7
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Franz.Common.Messaging.Hosting.RabbitMQ

A dedicated hosting library within the Franz Framework that provides RabbitMQ-specific hosted services and dependency injection extensions. This package bridges the RabbitMQ transport layer (Franz.Common.Messaging.RabbitMQ) with the .NET hosting infrastructure (Microsoft.Extensions.Hosting).


✨ Features

  • Hosted Services

    • RabbitMQHostedService – continuously consumes RabbitMQ messages and dispatches them.
    • OutboxHostedService – publishes stored outbox messages to RabbitMQ in the background.
    • MessagingHostedService – general-purpose hosted message orchestrator.
  • Dependency Injection Extensions

    • RabbitMQHostingServiceCollectionExtensions simplifies service registration in Startup/Program.cs.
    • Provides one-liners like AddRabbitMQHostedListener() and AddOutboxHostedListener().
  • Separation of Concerns

    • Keeps transport logic (Franz.Common.Messaging.RabbitMQ) separate from hosting concerns.
    • Makes testing listeners independent of the hosting runtime.
  • Observability

    • Structured logging with emoji conventions (✅ success, ⚠️ retries, 🔥 DLQ).
    • Compatible with OpenTelemetry for distributed tracing.

📂 Project Structure

Franz.Common.Messaging.Hosting.RabbitMQ/
├── Extensions/
│ └── RabbitMQHostingServiceCollectionExtensions.cs
├── HostedServices/
│ ├── RabbitMQHostedService.cs
│ ├── MessagingHostedService.cs
│ └── OutboxHostedService.cs
└── readme.md

⚙️ Dependencies

  • Microsoft.Extensions.Hosting (8.0.0)
  • Microsoft.Extensions.DependencyInjection.Abstractions (8.0.0)
  • Franz.Common.Messaging – core messaging abstractions
  • Franz.Common.Messaging.RabbitMQ – RabbitMQ transport adapter
  • Franz.Common.Messaging.Hosting – base hosting abstractions

🚀 Usage

1. Register RabbitMQ Hosted Services

In Program.cs or Startup.cs:

using Franz.Common.Messaging.Hosting.RabbitMQ.Extensions;

var host = Host.CreateDefaultBuilder(args)
 .ConfigureServices((context, services) =>
 {
 services.AddRabbitMQHostedListener(opts =>
 {
 opts.ConnectionString = context.Configuration["RabbitMQ:ConnectionString"];
 opts.ExchangeName = context.Configuration["RabbitMQ:ExchangeName"];
 });

 services.AddOutboxHostedListener(opts =>
 {
 opts.OutboxTable = context.Configuration["Outbox:TableName"];
 });
 })
 .Build();

await host.RunAsync();

2. RabbitMQ Hosted Service

Runs in the background to consume RabbitMQ messages and dispatch them via the mediator:

public class RabbitMQHostedService : BackgroundService
{
 protected override async Task ExecuteAsync(CancellationToken stoppingToken)
 {
 // Consumes RabbitMQ messages and dispatches
 }
}

3. Outbox Hosted Service

Ensures pending messages in MongoDB/SQL outbox are published to RabbitMQ reliably:

public class OutboxHostedService : BackgroundService
{
 protected override async Task ExecuteAsync(CancellationToken stoppingToken)
 {
 // Reads outbox, sends to RabbitMQ, handles retries/DLQ
 }
}

📊 Observability

  • Emoji logging (✅ processed, ⚠️ retry, 🔥 DLQ, 💤 idle).
  • Integrated with MessageContextAccessor for correlation IDs.
  • Tracing compatible with OpenTelemetry.

📝 Version Information

  • -Current Version: v2.2.7
  • Part of the private Franz Framework ecosystem.

📜 License

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


📖 Changelog

v2.0.1 – Internal Modernization

  • Messaging and infrastructure refactored for async, thread-safety, and modern .NET 10 patterns.
  • All APIs remain fully backward compatible.
  • Tests, listeners, and pipeline components modernized.

Version 1.6.2

  • Introduced RabbitMQHostedService to run RabbitMQ listeners inside .NET host.
  • Added OutboxHostedService to bridge Mongo/SQL outbox with RabbitMQ publishing.
  • Added RabbitMQHostingServiceCollectionExtensions for simple DI registration.
  • Unified hosted services with MessageContextAccessor and inbox idempotency support.
  • Improved logging with emoji conventions and OpenTelemetry hooks.

Version 1.6.20

  • Updated to .NET 10.0
Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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.RabbitMQ:

Package Downloads
Franz.Common.Messaging.Hosting.Mediator

Shared utility library for the Franz Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.7 113 6/7/2026
2.2.6 119 6/6/2026
2.2.5 120 6/4/2026
2.2.4 107 6/3/2026
2.2.3 114 6/2/2026
2.2.2 128 6/2/2026
2.2.1 113 5/24/2026
2.1.4 121 4/27/2026
2.1.3 110 4/26/2026
2.1.2 113 4/26/2026
2.1.1 121 4/22/2026
2.0.2 131 3/30/2026
2.0.1 125 3/29/2026
1.7.8 132 3/2/2026
1.7.7 138 1/31/2026
1.7.6 133 1/22/2026
1.7.5 139 1/10/2026
1.7.4 133 12/27/2025
1.7.3 207 12/22/2025
1.7.2 213 12/21/2025
Loading failed