From 2bdb34a738a27b1276385752975bbdc6ca84dee9 Mon Sep 17 00:00:00 2001 From: Travis Nickels Date: Tue, 21 Jan 2025 19:42:40 -0800 Subject: [PATCH] Start Rabbitmq documentation and upgrade guide --- transports/rabbitmq/connection-settings.md | 2 ++ ...management-api-url_rabbit_[,10).partial.md | 0 ...management-api-url_rabbit_[10,).partial.md | 20 +++++++++++++++++++ transports/upgrades/rabbitmq-9to10.md | 18 +++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 transports/rabbitmq/connection-settings_management-api-url_rabbit_[,10).partial.md create mode 100644 transports/rabbitmq/connection-settings_management-api-url_rabbit_[10,).partial.md diff --git a/transports/rabbitmq/connection-settings.md b/transports/rabbitmq/connection-settings.md index 11bb185f434..d716f3d1697 100644 --- a/transports/rabbitmq/connection-settings.md +++ b/transports/rabbitmq/connection-settings.md @@ -101,6 +101,8 @@ snippet: rabbitmq-external-auth-mechanism partial: add-cluster-node +partial: management-api-url + ## Controlling the prefetch count When consuming messages from the broker, throughput can be improved by having the consumer [prefetch](https://www.rabbitmq.com/consumer-prefetch.html) additional messages. diff --git a/transports/rabbitmq/connection-settings_management-api-url_rabbit_[,10).partial.md b/transports/rabbitmq/connection-settings_management-api-url_rabbit_[,10).partial.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/transports/rabbitmq/connection-settings_management-api-url_rabbit_[10,).partial.md b/transports/rabbitmq/connection-settings_management-api-url_rabbit_[10,).partial.md new file mode 100644 index 00000000000..361ee43c939 --- /dev/null +++ b/transports/rabbitmq/connection-settings_management-api-url_rabbit_[10,).partial.md @@ -0,0 +1,20 @@ +## Configuring RabbitMQ delivery limit check + +> [!NOTE] +> RabbitMQ version 4.0 and above sets a default delivery limit value of 20 messages on queue creation. Setting the delivery limit to unlimited (-1) is critical for the proper functioning of the NServiceBus recoverability process. Ensure that this setting is configured in your RabbitMQ node if the check is disabled. + +The transport can verify that the RabbitMQ delivery limit is set to unlimited (-1) using the management API. This ensures that the NServiceBus recoverability process works correctly, preventing potential message loss. For this check to function, the RabbitMQ management plugin must be enabled on the RabbitMQ node. + +To configure the HTTP client and perform the delivery limit check, set the authentication details as follows: + +```csharp +var transport = new RabbitMQTransport(RoutingTopology.Conventional(QueueType.Quorum), "host=localhost") +{ + ManagementApiUrl = "http://username:password@localhost:15672"; +} + +// Or + +var transport = endpointConfiguration.UseTransport(); +transport.ManagementApiUrl("http://username:password@localhost:15672"); +``` \ No newline at end of file diff --git a/transports/upgrades/rabbitmq-9to10.md b/transports/upgrades/rabbitmq-9to10.md index 52580f522dd..07e6e9ae992 100644 --- a/transports/upgrades/rabbitmq-9to10.md +++ b/transports/upgrades/rabbitmq-9to10.md @@ -16,6 +16,24 @@ The transport now uses [RabbitMQ.Client v7.0.0](https://www.nuget.org/packages/R For details, see the [RabbitMQ client changelog](https://github.com/rabbitmq/rabbitmq-dotnet-client/releases/tag/v7.0.0). +## RabbitMQ Management API + +The transport has introduced a client connection to the HTTP-based RabbitMQ management API. This requires the [rabbitmq management plugin](https://www.rabbitmq.com/docs/management#getting-started) to be enabled on the node. The client uses [basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) to connect with the RabbitMQ management API and is configured via the `ManagementApiUrl` transport property. + +For more details about the configuration, see [Configuring RabbitMQ delivery limit check](/transports/rabbitmq/connection-settings.md#configuring-rabbitmq-delivery-limit-check). + +```CSharp +var transport = new RabbitMQTransport(RoutingTopology.Conventional(QueueType.Quorum), "host=localhost") +{ + ManagementApiUrl = "http://username:password@localhost:15672"; +} + +// Or + +var transport = endpointConfiguration.UseTransport(); +transport.ManagementApiUrl("http://username:password@localhost:15672"); +``` + ### `IRoutingTopology` Updates The following changes have been made to `IRoutingTopology`: