SquidStd.Messaging.RabbitMq
0.25.0
dotnet add package SquidStd.Messaging.RabbitMq --version 0.25.0
NuGet\Install-Package SquidStd.Messaging.RabbitMq -Version 0.25.0
<PackageReference Include="SquidStd.Messaging.RabbitMq" Version="0.25.0" />
<PackageVersion Include="SquidStd.Messaging.RabbitMq" Version="0.25.0" />
<PackageReference Include="SquidStd.Messaging.RabbitMq" />
paket add SquidStd.Messaging.RabbitMq --version 0.25.0
#r "nuget: SquidStd.Messaging.RabbitMq, 0.25.0"
#:package SquidStd.Messaging.RabbitMq@0.25.0
#addin nuget:?package=SquidStd.Messaging.RabbitMq&version=0.25.0
#tool nuget:?package=SquidStd.Messaging.RabbitMq&version=0.25.0
<h1 align="center">SquidStd.Messaging.RabbitMq</h1>
RabbitMQ transport for SquidStd.Messaging. Implements IQueueProvider and ITopicProvider on top of the
RabbitMQ client, so the same IMessageQueue / IMessageTopic API that runs in-memory during tests
publishes to and consumes from a real broker in production - registered with a single
AddRabbitMqMessaging(...) call.
The provider declares durable quorum queues and publishes persistent messages, so queued work survives
broker restarts. Each queue gets a companion dead-letter queue (<queue>.dlq by default), wired via
x-delivery-limit so the broker itself moves a message there after MaxDeliveryAttempts failed
deliveries. Connections are created with automatic recovery enabled, and consumers apply the configured
prefetch via basic QoS. Topics map to fan-out exchanges with an exclusive, auto-delete queue per
subscriber - topic delivery is live fan-out, not durable.
Install
dotnet add package SquidStd.Messaging.RabbitMq
Usage
Register through the bootstrap - the providers are ISquidStdServices, so bootstrap.StartAsync() opens
the broker connection and StopAsync closes it:
using SquidStd.Messaging.Abstractions.Interfaces;
using SquidStd.Messaging.RabbitMq.Data.Config;
using SquidStd.Messaging.RabbitMq.Extensions;
using SquidStd.Services.Core.Extensions;
using SquidStd.Services.Core.Services.Bootstrap;
var bootstrap = SquidStdBootstrap.Create(o => o.ConfigName = "myapp");
bootstrap.ConfigureServices(c => c.RegisterCoreServices().AddRabbitMqMessaging(new RabbitMqOptions
{
HostName = "rabbit.internal",
UserName = "app",
Password = "secret"
}));
await bootstrap.StartAsync();
Publishing and consuming are identical to the in-memory provider - the contracts come from
SquidStd.Messaging.Abstractions:
var queue = bootstrap.Resolve<IMessageQueue>();
using (queue.Subscribe("orders", new OrderListener())) // IQueueMessageListenerAsync<OrderPlaced>
{
await queue.PublishAsync("orders", new OrderPlaced("order-1"));
}
var topic = bootstrap.Resolve<IMessageTopic>();
using var sub = topic.Subscribe<OrderPlaced>("order-events", (order, _) =>
{
Console.WriteLine($"topic saw {order.Id}");
return Task.CompletedTask;
});
Configuration
AddRabbitMqMessaging(RabbitMqOptions options, MessagingOptions? messagingOptions = null) takes the
connection settings plus the shared messaging options (delivery attempts, dead-letter suffix). Options are
code-only - this package registers no YAML config section.
RabbitMqOptions property |
Default | Purpose |
|---|---|---|
HostName |
"localhost" |
Broker host. |
Port |
5672 |
Broker port. |
VirtualHost |
"/" |
Virtual host. |
UserName |
"guest" |
User name. |
Password |
"guest" |
Password. |
Uri |
null |
AMQP URI; when set it overrides the fields above. |
PrefetchCount |
10 |
Consumer prefetch (basic QoS) per subscriber. |
A connection-string overload is also available:
AddRabbitMqMessaging("rabbitmq://app:secret@rabbit.internal:5672/myvhost?prefetch=20&maxDeliveryAttempts=5").
MessagingMetricsProvider is registered as IMessagingMetrics / IMetricProvider; the provider reports
published, delivered, and failed counts plus subscriber counts per queue.
Key types
| Type | Purpose |
|---|---|
RabbitMqMessagingRegistrationExtensions |
AddRabbitMqMessaging(...) registration. |
RabbitMqQueueProvider |
Quorum-queue IQueueProvider with broker-side DLQ. |
RabbitMqTopicProvider |
Fan-out exchange ITopicProvider. |
RabbitMqOptions |
Connection + prefetch configuration. |
Related
- Article: Messaging with RabbitMQ
- Article: Messaging
- Tutorial: Messaging
- Siblings: SquidStd.Messaging (in-memory), SquidStd.Messaging.Sqs
License
MIT - part of SquidStd.
| 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
- DryIoc.dll (>= 5.4.3)
- RabbitMQ.Client (>= 7.2.1)
- SquidStd.Messaging.Abstractions (>= 0.25.0)
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 |
|---|---|---|
| 0.25.0 | 0 | 7/6/2026 |
| 0.24.1 | 0 | 7/6/2026 |
| 0.24.0 | 7 | 7/6/2026 |
| 0.23.0 | 42 | 7/4/2026 |
| 0.22.0 | 41 | 7/4/2026 |
| 0.21.0 | 41 | 7/3/2026 |
| 0.20.0 | 44 | 7/3/2026 |
| 0.19.0 | 54 | 7/3/2026 |
| 0.18.0 | 47 | 7/3/2026 |
| 0.17.0 | 49 | 7/3/2026 |
| 0.16.0 | 50 | 7/3/2026 |
| 0.15.0 | 50 | 7/2/2026 |
| 0.14.1 | 47 | 7/2/2026 |
| 0.14.0 | 46 | 7/2/2026 |
| 0.13.0 | 42 | 7/2/2026 |
| 0.12.0 | 42 | 7/2/2026 |
| 0.11.0 | 44 | 7/2/2026 |
| 0.10.0 | 80 | 6/30/2026 |
| 0.9.0 | 118 | 6/29/2026 |
| 0.8.0 | 113 | 6/28/2026 |