diff --git a/docs/messaging/media/dashboard-access-rabbitmq-management.png b/docs/messaging/media/dashboard-access-rabbitmq-management.png new file mode 100644 index 0000000000..4fafaad349 Binary files /dev/null and b/docs/messaging/media/dashboard-access-rabbitmq-management.png differ diff --git a/docs/messaging/media/rabbitmq-management-plugin.png b/docs/messaging/media/rabbitmq-management-plugin.png new file mode 100644 index 0000000000..2c4e882055 Binary files /dev/null and b/docs/messaging/media/rabbitmq-management-plugin.png differ diff --git a/docs/messaging/rabbitmq-integration.md b/docs/messaging/rabbitmq-integration.md index 15ece97649..04e25af1d3 100644 --- a/docs/messaging/rabbitmq-integration.md +++ b/docs/messaging/rabbitmq-integration.md @@ -58,24 +58,6 @@ The method conf > [!TIP] > If you'd rather connect to an existing RabbitMQ server, call instead. For more information, see [Reference existing resources](../fundamentals/app-host-overview.md#reference-existing-resources). -### Add RabbitMQ server resource with management plugin - -To add the [RabbitMQ management plugin](https://www.rabbitmq.com/docs/management) to the RabbitMQ server resource, call the method: - -```csharp -var builder = DistributedApplication.CreateBuilder(args); - -var rabbitmq = builder.AddRabbitMQ("messaging") - .WithManagementPlugin(); - -builder.AddProject() - .WithReference(rabbitmq); - -// After adding all resources, run the app... -``` - -The RabbitMQ management plugin provides an HTTP-based API for management and monitoring of your RabbitMQ server. .NET Aspire adds another container image [`docker.io/library/rabbitmq-management`](https://hub.docker.com/_/rabbitmq) to the app host that runs the management plugin. - ### Add RabbitMQ server resource with data volume To add a data volume to the RabbitMQ server resource, call the method on the RabbitMQ server resource: @@ -136,6 +118,33 @@ builder.AddProject() For more information on providing parameters, see [External parameters](../fundamentals/external-parameters.md). +### Add RabbitMQ server resource with management plugin + +To add the [RabbitMQ management plugin](https://www.rabbitmq.com/docs/management) to the RabbitMQ server resource, call the method. Remember to use parameters to set the credentials for the container. You'll need these credentials to log into the management plugin: + +```csharp +var builder = DistributedApplication.CreateBuilder(args); + +var username = builder.AddParameter("username", secret: true); +var password = builder.AddParameter("password", secret: true); + +var rabbitmq = builder.AddRabbitMQ("messaging", username, password) + .WithManagementPlugin(); + +builder.AddProject() + .WithReference(rabbitmq); + +// After adding all resources, run the app... +``` + +The RabbitMQ management plugin provides an HTTP-based API for management and monitoring of your RabbitMQ server. .NET Aspire adds another container image [`docker.io/library/rabbitmq-management`](https://hub.docker.com/_/rabbitmq) to the app host that runs the management plugin. You can access the management plugin from the .NET Aspire dashboard by selecting an endpoint for your RabbitMQ resource: + +:::image type="content" source="media/dashboard-access-rabbitmq-management.png" alt-text="Screenshot of the .NET Aspire dashboard showing how to connect to the RabbitMQ management plugin."::: + +Log into the management plugin using the credentials you configured with parameters: + +:::image type="content" source="media/rabbitmq-management-plugin.png" alt-text="Screenshot of the RabbitMQ management plugin."::: +