Raycynix.Extensions.Messaging.RabbitMQ
2.2.0
dotnet add package Raycynix.Extensions.Messaging.RabbitMQ --version 2.2.0
NuGet\Install-Package Raycynix.Extensions.Messaging.RabbitMQ -Version 2.2.0
<PackageReference Include="Raycynix.Extensions.Messaging.RabbitMQ" Version="2.2.0" />
<PackageVersion Include="Raycynix.Extensions.Messaging.RabbitMQ" Version="2.2.0" />
<PackageReference Include="Raycynix.Extensions.Messaging.RabbitMQ" />
paket add Raycynix.Extensions.Messaging.RabbitMQ --version 2.2.0
#r "nuget: Raycynix.Extensions.Messaging.RabbitMQ, 2.2.0"
#:package Raycynix.Extensions.Messaging.RabbitMQ@2.2.0
#addin nuget:?package=Raycynix.Extensions.Messaging.RabbitMQ&version=2.2.0
#tool nuget:?package=Raycynix.Extensions.Messaging.RabbitMQ&version=2.2.0
Raycynix.Extensions.Messaging.RabbitMQ
Raycynix.Extensions.Messaging.RabbitMQ contains the RabbitMQ transport integration for Raycynix messaging.
What it contains
AddRabbitMq(...)RabbitMqMessagingConfigurationRabbitMqExchangeConfigurationRabbitMqQueueConfigurationRabbitMqRetryConfigurationRabbitMqDeadLetterConfiguration- RabbitMQ-backed
IMessagePublisher - automatic exchange, queue, binding, and dead-letter topology bootstrap
- message publishing to RabbitMQ exchanges using
MessageEnvelope<TMessage>.Destinationas the routing key
What it does not contain
- RabbitMQ consumer hosted services
- retry execution pipeline
- poison-message processing workers
- outbox persistence
- inbox/idempotency storage
Usage
Example appsettings.json:
{
"RabbitMqMessagingConfiguration": {
"Host": "localhost",
"Port": 5672,
"Exchange": {
"Name": "integration.events",
"Type": "topic"
},
"Queue": {
"Name": "orders.created",
"PrefetchCount": 16
},
"DeadLetter": {
"Enabled": true,
"Exchange": "integration.dlx",
"Queue": "integration.dlq",
"RoutingKey": "dead-letter"
}
}
}
Register the transport:
builder.Services.AddRaycynixMessaging(builder.Configuration)
.AddRabbitMq(builder.Configuration);
Publish to RabbitMQ:
public class OrderPublisher(
IMessageEnvelopeFactory envelopeFactory,
IMessagePublisher messagePublisher)
{
public async Task PublishAsync(string orderId, CancellationToken cancellationToken)
{
var envelope = envelopeFactory.Create(
new OrderCreatedMessage(orderId),
destination: "orders.created",
format: MessageFormat.Json);
await messagePublisher.PublishAsync(envelope, cancellationToken);
}
}
The package declares the configured exchange and queue on first use, binds the queue using the queue name as the routing key, and publishes messages with the envelope destination as the routing key.
Published AMQP properties include:
MessageIdCorrelationIdContentType- contract/version headers from the base messaging layer
Logging
The RabbitMQ transport uses optional Microsoft ILogger<T> diagnostics when logging is registered in the application. No Raycynix logging provider is required.
Diagnostics cover publish attempts, inbound consumer startup, delivery processing, acknowledgements, retry republishes, dead-letter republishes, and rejects. Message payloads, header values, credentials, and connection strings are not logged.
| 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.Logging.Abstractions (>= 10.0.9)
- RabbitMQ.Client (>= 7.2.1)
- Raycynix.Extensions.Messaging (>= 2.2.0)
- System.Threading.RateLimiting (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Starts unified versioning for Raycynix packages from this release and adds optional Microsoft.Extensions.Logging diagnostics for RabbitMQ transport operations.