CommunityToolkit.Aspire.Hosting.Mosquitto
13.5.0
Prefix Reserved
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Mosquitto --version 13.5.0
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Mosquitto -Version 13.5.0
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Mosquitto" Version="13.5.0" />
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Mosquitto" Version="13.5.0" />
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Mosquitto" />
paket add CommunityToolkit.Aspire.Hosting.Mosquitto --version 13.5.0
#r "nuget: CommunityToolkit.Aspire.Hosting.Mosquitto, 13.5.0"
#:package CommunityToolkit.Aspire.Hosting.Mosquitto@13.5.0
#addin nuget:?package=CommunityToolkit.Aspire.Hosting.Mosquitto&version=13.5.0
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Mosquitto&version=13.5.0
CommunityToolkit.Aspire.Hosting.Mosquitto
Overview
This Aspire hosting integration runs Eclipse Mosquitto in a container. Mosquitto is an open source MQTT message broker, so the resource can be referenced by any MQTT client integration. The integration exposes the MQTT endpoint on port 1883 (target port tcp) and a protocol-level health check so the broker only reports healthy once it actually accepts MQTT connections.
Usage
Example 1: Add a Mosquitto broker
var builder = DistributedApplication.CreateBuilder(args);
var mqtt = builder.AddMosquitto("mqtt");
builder.AddProject<Projects.MyApp>("myapp")
.WithReference(mqtt)
.WaitFor(mqtt);
builder.Build().Run();
The connection string injected into the referencing resource is the broker address in the form mqtt://host:port.
Example 2: Pin the MQTT host port
var mqtt = builder.AddMosquitto("mqtt", port: 1883);
Example 3: Persist data with a volume or bind mount
var mqtt = builder.AddMosquitto("mqtt")
.WithDataVolume();
// or
var mqtt = builder.AddMosquitto("mqtt")
.WithDataBindMount("./mosquitto-data");
Example 4: Mount a custom configuration
By default the integration ships a mosquitto.conf that exposes the MQTT listener on all interfaces (listener 1883), allows anonymous connections, and persists state to /mosquitto/data. To customize the broker, override the configuration with your own mosquitto.conf at /mosquitto/config:
var mqtt = builder.AddMosquitto("mqtt")
.WithContainerFiles("/mosquitto/config",
[new ContainerFile { Name = "mosquitto.conf", Contents = "listener 1883" }]);
Endpoints
| Name | Description |
|---|---|
tcp |
MQTT protocol endpoint (port 1883) |
Upstream Image
This integration pins the eclipse-mosquitto image (from docker.io) to a specific version tag (2.0.22) rather than a floating tag. Mosquitto publishes immutable, fully-versioned tags; update the pinned tag to adopt newer releases.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Aspire.Hosting (>= 13.5.0)
- MessagePack (>= 2.5.302)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.11)
- MQTTnet (>= 5.2.0.1603)
-
net8.0
- Aspire.Hosting (>= 13.5.0)
- MessagePack (>= 2.5.302)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.11)
- MQTTnet (>= 5.2.0.1603)
-
net9.0
- Aspire.Hosting (>= 13.5.0)
- MessagePack (>= 2.5.302)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.11)
- MQTTnet (>= 5.2.0.1603)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.5.1-beta.748 | 45 | 9/7/2026 |
| 13.5.1-beta.744 | 44 | 9/7/2026 |
| 13.5.1-beta.743 | 55 | 9/7/2026 |
| 13.5.1-beta.736 | 51 | 9/1/2026 |
| 13.5.0 | 121 | 8/25/2026 |
| 13.5.0-beta.731 | 66 | 8/24/2026 |