RabbitX 1.2.4
Requires NuGet 6.0 or higher.
dotnet add package RabbitX --version 1.2.4
NuGet\Install-Package RabbitX -Version 1.2.4
<PackageReference Include="RabbitX" Version="1.2.4" />
<PackageVersion Include="RabbitX" Version="1.2.4" />
<PackageReference Include="RabbitX" />
paket add RabbitX --version 1.2.4
#r "nuget: RabbitX, 1.2.4"
#:package RabbitX@1.2.4
#addin nuget:?package=RabbitX&version=1.2.4
#tool nuget:?package=RabbitX&version=1.2.4

RabbitX
The Modern RabbitMQ Integration for .NET 10+
RabbitX is a robust RabbitMQ abstraction library designed exclusively for modern .NET applications. Built on top of the official RabbitMQ.Client 7.x and Polly 8.x, it provides a clean fluent API for publishers and consumers, built-in resilience patterns, retry policies with exponential backoff, dead letter exchange support, and RPC capabilities.
Version 1.x marks the initial release: a complete RabbitMQ integration solution with 100% feature parity between Fluent API and appsettings.json configuration, comprehensive retry strategies, and automatic dead letter exchange handling.
Our philosophy is simple: make RabbitMQ integration as straightforward as possible while providing enterprise-grade reliability. RabbitX is built with the latest C# 14 features and targets .NET 10. This is not just another library; it's a commitment to simplifying message-driven architectures.
💖 Support the Project
RabbitX is a passion project, driven by the desire to simplify RabbitMQ integration for the .NET community. Maintaining this library requires significant effort: staying current with each .NET release, addressing issues promptly, implementing new features, and keeping documentation up to date.
If RabbitX has helped you build better applications or saved you development time, I would be incredibly grateful for your support. Your contribution—no matter the size—helps me dedicate time to respond to issues quickly, implement improvements, and keep the library evolving alongside the .NET platform.
I'm also looking for sponsors who believe in this project's mission. Sponsorship helps ensure RabbitX remains actively maintained and continues to serve the .NET community for years to come.
Of course, there's absolutely no obligation. If you prefer, simply starring the repository or sharing RabbitX with fellow developers is equally appreciated!
⭐ Star the repository on GitHub to raise its visibility
💬 Share RabbitX with your team or community
☕ Support via Donations:
✨ Features
- Fluent API: Type-safe configuration with full IntelliSense support
- appsettings.json: Complete configuration from JSON files with 100% parity
- Multiple Publishers & Consumers: Configure and use multiple named publishers and consumers
- Reliable Publishing: Publisher confirmations with broker acknowledgments
- Retry Policies: Specific delays or exponential backoff with jitter support
- Dead Letter Exchange: Automatic DLX setup for failed message routing
- RPC Support: Request-Reply pattern with Direct Reply-To optimization
- QoS Control: Prefetch count, prefetch size, and global QoS settings
- Connection Recovery: Automatic reconnection on connection failures
- Polly Integration: Built-in resilience with the Polly library
- Health Checks: Built-in health check for ASP.NET Core with connection and blocked state detection
- OpenTelemetry: Distributed tracing, metrics, and W3C TraceContext propagation
🎉 What's New in 1.2.0
OpenTelemetry Instrumentation! RabbitX 1.2.0 adds full observability support:
- Distributed Tracing: Automatic spans for publish, consume, and RPC operations following OTel Messaging Semantic Conventions
- 16 Metrics: Counters and histograms for messages published/consumed, durations, errors, retries, RPC calls, and connections
- W3C TraceContext: Automatic propagation of
traceparent/tracestatethrough AMQP headers, linking producer and consumer spans across services - Zero Overhead: No performance impact when OpenTelemetry SDK is not configured
// Add RabbitX tracing and metrics to your OTel pipeline
builder.Services.AddOpenTelemetry()
.WithTracing(tracing => tracing
.AddRabbitXInstrumentation()
.AddOtlpExporter())
.WithMetrics(metrics => metrics
.AddRabbitXInstrumentation()
.AddOtlpExporter());
See CHANGELOG.md for full details.
🚀 Getting Started
Installation
dotnet add package RabbitX
Configuration
Register RabbitX in your Program.cs with either Fluent API or appsettings.json.
Option A: Fluent API
builder.Services.AddRabbitX(options => options
.UseConnection("localhost", 5672)
.UseCredentials("guest", "guest")
.AddPublisher("OrderPublisher", pub => pub
.ToExchange("shop.orders.exchange", "topic")
.WithRoutingKey("orders.created"))
.AddConsumer("OrderConsumer", con => con
.FromQueue("shop.orders.created.queue")
.BindToExchange("shop.orders.exchange", "orders.created")));
Option B: appsettings.json
{
"RabbitX": {
"Connection": { "HostName": "localhost", "UserName": "guest", "Password": "guest" },
"Publishers": {
"OrderPublisher": { "Exchange": "shop.orders.exchange", "ExchangeType": "topic", "RoutingKey": "orders.created" }
},
"Consumers": {
"OrderConsumer": { "Queue": "shop.orders.created.queue", "Exchange": "shop.orders.exchange", "RoutingKey": "orders.created" }
}
}
}
builder.Services.AddRabbitX(builder.Configuration);
Publishing Messages
Inject IPublisherFactory and create a publisher to send messages:
public record OrderCreated(Guid OrderId, string CustomerId, decimal Total);
public class OrderService(IPublisherFactory factory)
{
public async Task CreateOrderAsync(Order order)
{
var publisher = factory.CreateReliablePublisher<OrderCreated>("OrderPublisher");
var message = new OrderCreated(order.Id, order.CustomerId, order.Total);
await publisher.PublishWithConfirmAsync(message);
}
}
Consuming Messages
Create a handler to process incoming messages:
public class OrderCreatedHandler : IMessageHandler<OrderCreated>
{
public Task<ConsumeResult> HandleAsync(MessageContext<OrderCreated> context, CancellationToken ct)
{
var order = context.Message;
Console.WriteLine($"Processing order {order.OrderId} for {order.CustomerId}");
// Process the order...
return Task.FromResult(ConsumeResult.Ack);
}
}
Register the handler and start the consumer as a hosted service:
builder.Services.AddMessageHandler<OrderCreated, OrderCreatedHandler>();
builder.Services.AddHostedConsumer<OrderCreated>("OrderConsumer");
📅 Versioning & .NET Support Policy
RabbitX follows a clear versioning strategy aligned with .NET's release cadence:
Version History
| RabbitX | .NET | C# | Status |
|---|---|---|---|
| 1.x | .NET 10 | C# 14 | Current |
Future Support Policy
RabbitX will always support the current LTS version plus the next standard release. When a new LTS version is released, support for older versions will be discontinued:
| RabbitX | .NET | C# | Notes |
|---|---|---|---|
| 1.x | .NET 10 | C# 14 | LTS only |
| 2.x | .NET 10 + .NET 11 | C# 14 / C# 15 | LTS + Standard |
| 3.x | .NET 12 | C# 16 | New LTS (drops .NET 10/11) |
Why this policy?
- Focused development: By limiting supported versions, we can dedicate more effort to quality, performance, and new features
- Modern features: Each .NET version brings improvements that RabbitX can fully leverage
- Clear upgrade path: Users know exactly when to plan their upgrades
Note: We recommend always using the latest LTS version of .NET for production applications.
📚 Documentation
Comprehensive guides to help you master RabbitX:
Getting Started
- Getting Started - Installation, requirements, and first message
- Configuration - Fluent API and appsettings.json complete reference
Core Features
- Publishers - Publishing messages with confirms
- Consumers - Consuming messages with handlers
- RPC - Request-Reply pattern
Advanced Topics
- Retry & Resilience - Retry policies and strategies
- Dead Letter Queues - DLX configuration
- Health Checks - ASP.NET Core health check integration
- OpenTelemetry - Distributed tracing, metrics, and context propagation
Examples
Check out the samples folder for complete working examples.
📋 Requirements
- .NET 10.0 or later
- RabbitMQ 3.12+ (recommended)
- RabbitMQ.Client 7.0.0 (included as dependency)
- Polly 8.5.0 (included as dependency)
🙏 Acknowledgments
RabbitX is built on top of excellent open-source libraries:
- RabbitMQ.Client - The official RabbitMQ .NET client by VMware
- Polly - The resilience and transient-fault-handling library
We are immensely grateful for their contribution to the .NET ecosystem, which provided the foundation for this library.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- OpenTelemetry.Api (>= 1.15.3)
- Polly (>= 8.6.6)
- RabbitMQ.Client (>= 7.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.2.4 - Pin the frozen-vector test for DeterministicMessageId so the canonical Guid output of For("PAY-1", 0, 0, "Request") is fixed across releases. No runtime change; the algorithm and its output were already correct in 1.2.3. This release re-publishes with the test placeholder replaced by the actual pinned value so dotnet test passes out of the box.