LinKit.Messaging.RabbitMQ 1.2.0

dotnet add package LinKit.Messaging.RabbitMQ --version 1.2.0
                    
NuGet\Install-Package LinKit.Messaging.RabbitMQ -Version 1.2.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="LinKit.Messaging.RabbitMQ" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinKit.Messaging.RabbitMQ" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="LinKit.Messaging.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 LinKit.Messaging.RabbitMQ --version 1.2.0
                    
#r "nuget: LinKit.Messaging.RabbitMQ, 1.2.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 LinKit.Messaging.RabbitMQ@1.2.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=LinKit.Messaging.RabbitMQ&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=LinKit.Messaging.RabbitMQ&version=1.2.0
                    
Install as a Cake Tool

LinKit.Messaging.RabbitMQ

NuGet Version NuGet Downloads

This package provides a RabbitMQ broker adapter for the messaging abstractions in LinKit.Core. Core source generation wires supported message declarations and consumers to this broker adapter.

Prerequisites

  • You must have LinKit.Core installed.
  • You need access to a running RabbitMQ instance.

Generated consumers remain active until host shutdown. Failed deliveries are requeued by default (RequeueOnFailure=true); configure a dead-letter exchange and set this option to false only when rejected messages are routed to a durable dead-letter queue. Requeued poison messages can otherwise redeliver repeatedly, so handlers should be idempotent and deployments should define a dead-letter policy.

For trimmed or Native AOT applications, define and register a System.Text.Json source-generated context containing every message type used by producers and consumers:

using System.Text.Json.Serialization;
using LinKit.Core.Messaging;

[JsonSerializable(typeof(OrderCreated))]
internal partial class AppMessageJsonContext : JsonSerializerContext;

LinKitMessageJson.AddContext(AppMessageJsonContext.Default);

Register the context before publishing or starting consumers. A reflection fallback may be available when dynamic code is enabled; do not rely on it in Native AOT.

Installation

dotnet add package LinKit.Messaging.RabbitMQ

How to Use

1. Configure appsettings.json

Add a configuration section for your RabbitMQ connection. The default section name is "RabbitMQ".

{
  "RabbitMQ": {
    "HostName": "localhost",
    "UserName": "guest",
    "Password": "guest",
    "Port": 5672,
    "VirtualHost": "/",
    "PrefetchCount": 50,
    "ChannelPoolSize": 64,
    "RequeueOnFailure": true
  }
}

2. Register Services in Program.cs

In your application's startup code (e.g., Program.cs for a Worker Service), use the AddLinKitRabbitMQ() extension method after registering the core LinKit services.

using LinKit.Core;
using LinKit.Messaging.RabbitMQ;

var builder = Host.CreateApplicationBuilder(args);

// 1. Register core LinKit services. 
// This generates the IMessagePublisher and your consumer IHostedService(s).
builder.Services.AddLinKitCqrs();
builder.Services.AddLinKitMessaging(); 

// 2. Provide the RabbitMQ implementation.
// This "plugs in" RabbitMQ to the generated services.
builder.Services.AddLinKitRabbitMQ(builder.Configuration);

var host = builder.Build();
host.Run();

AddLinKitRabbitMQ registers the producer and consumer connection. Producer sends persistent messages and waits for publisher confirms; consumer uses manual acknowledgements. Delivery remains at-least-once. This adapter does not implement retry counters, delayed retries, or a DLQ policy. Configure broker dead-letter routing and set RequeueOnFailure appropriately to avoid poison-message loops. Test reconnection/recovery behavior against the RabbitMQ version and topology used in production.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 0 10/22/2026
1.1.0 48 10/20/2026
1.0.0 307 8/29/2025