![]() |
VOOZH | about |
dotnet add package Raycynix.Extensions.Messaging.RabbitMQ --version 1.0.1
NuGet\Install-Package Raycynix.Extensions.Messaging.RabbitMQ -Version 1.0.1
<PackageReference Include="Raycynix.Extensions.Messaging.RabbitMQ" Version="1.0.1" />
<PackageVersion Include="Raycynix.Extensions.Messaging.RabbitMQ" Version="1.0.1" />Directory.Packages.props
<PackageReference Include="Raycynix.Extensions.Messaging.RabbitMQ" />Project file
paket add Raycynix.Extensions.Messaging.RabbitMQ --version 1.0.1
#r "nuget: Raycynix.Extensions.Messaging.RabbitMQ, 1.0.1"
#:package Raycynix.Extensions.Messaging.RabbitMQ@1.0.1
#addin nuget:?package=Raycynix.Extensions.Messaging.RabbitMQ&version=1.0.1Install as a Cake Addin
#tool nuget:?package=Raycynix.Extensions.Messaging.RabbitMQ&version=1.0.1Install as a Cake Tool
Raycynix.Extensions.Messaging.RabbitMQ contains the RabbitMQ transport integration for Raycynix messaging.
AddRabbitMq(...)RabbitMqMessagingConfigurationRabbitMqExchangeConfigurationRabbitMqQueueConfigurationRabbitMqRetryConfigurationRabbitMqDeadLetterConfigurationIMessagePublisherMessageEnvelope<TMessage>.Destination as the routing keyExample 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| 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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
See the package-local CHANGELOG.md for the full change history. Override PackageReleaseNotes in the package project file for major release-specific notes.