Aspire.Hosting.RabbitMQ 13.1.2

Aspire.Hosting.RabbitMQ library

Provides extension methods and resource definitions for an Aspire AppHost to configure a RabbitMQ resource.

Getting started

Install the package

In your AppHost project, install the Aspire RabbitMQ Hosting library with NuGet:

dotnet add package Aspire.Hosting.RabbitMQ

Usage example

Then, in the AppHost.cs file of AppHost, add a RabbitMQ resource and consume the connection using the following methods:

var rmq = builder.AddRabbitMQ("rmq");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(rmq);

Connection Properties

When you reference a RabbitMQ resource using WithReference, the following connection properties are made available to the consuming project:

RabbitMQ server

The RabbitMQ server resource exposes the following connection properties:

Property Name Description
Host The hostname or IP address of the RabbitMQ server
Port The port number the RabbitMQ server is listening on
Username The username for authentication
Password The password for authentication
Uri The connection URI, with the format amqp://{Username}:{Password}@{Host}:{Port}

Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called db1 becomes DB1_URI.

Additional documentation

Feedback & contributing

https://github.com/dotnet/aspire

No packages depend on Aspire.Hosting.RabbitMQ.

Version Downloads Last updated
13.1.2 2 01.03.2026
13.1.1 2 21.02.2026
13.1.0 1 11.02.2026
13.0.2 3 12.12.2025
13.0.1 3 12.12.2025
13.0.0 3 12.12.2025
9.5.2 2 13.12.2025
9.5.1 3 10.11.2025
9.5.0 3 27.09.2025
9.4.2 5 05.09.2025
9.4.1 5 05.09.2025
9.4.0 5 05.09.2025
9.3.1 5 05.09.2025
9.3.0 5 05.09.2025
9.2.1 5 05.09.2025
9.2.0 5 05.09.2025
9.1.0 6 04.09.2025
9.0.0 5 05.09.2025
9.0.0-rc.1.24511.1 3 05.09.2025
8.2.2 4 05.09.2025
8.2.1 5 05.09.2025
8.2.0 5 05.09.2025
8.1.0 5 05.09.2025
8.0.2 5 05.09.2025
8.0.1 5 05.09.2025
8.0.0 5 05.09.2025
8.0.0-preview.7.24251.11 3 05.09.2025
8.0.0-preview.6.24214.1 3 05.09.2025
8.0.0-preview.5.24201.12 4 05.09.2025