Skip to content

New Integration Component: CommunityToolkit.Aspire.Hosting.Mosquitto - #1520

Merged
aaronpowell merged 8 commits into
CommunityToolkit:mainfrom
IgorShaposhnikov:feature/mqtt
Aug 20, 2026
Merged

New Integration Component: CommunityToolkit.Aspire.Hosting.Mosquitto#1520
aaronpowell merged 8 commits into
CommunityToolkit:mainfrom
IgorShaposhnikov:feature/mqtt

Conversation

@IgorShaposhnikov

Copy link
Copy Markdown
Contributor

Closes #1519

This PR introduces a new hosting integration for Eclipse Mosquitto (CommunityToolkit.Aspire.Hosting.Mosquitto). It allows developers to seamlessly orchestrate and run an Eclipse Mosquitto MQTT broker inside a container as part of their .NET Aspire distributed application topology.

Overview of Changes

  • Added CommunityToolkit.Aspire.Hosting.Mosquitto project to the toolkit.
  • Implemented AddMosquitto extension method on IDistributedApplicationBuilder.
  • Configured a TCP endpoint mapping to the default MQTT port 1883.
  • Integrated a protocol-level health check to ensure the resource only reports healthy once it actively accepts TCP/MQTT traffic.
  • Added support for data persistence (WithDataVolume and WithDataBindMount) and configuration overrides (mosquitto.conf).
  • Added comprehensive unit/integration tests and XML documentation.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
  • Docs are written
  • Added description of major feature to project description for NuGet package
  • Tests for the changes have been added (for bug fixes / features)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

The implementation pins the eclipse-mosquitto image from docker.io to the stable, fully-versioned release tag 2.0.22 rather than using a floating tag, ensuring deterministic local builds for developers.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1520

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1520"

@IgorShaposhnikov

Copy link
Copy Markdown
Contributor Author

@IgorShaposhnikov please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

@IgorShaposhnikov IgorShaposhnikov changed the title Feature/mqtt New Integration Component: CommunityToolkit.Aspire.Hosting.Mosquitto Aug 11, 2026

@aaronpowell aaronpowell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the inline suggestions to get this ready for release under the 13.5 version of Aspire.

It might be worth having a follow-up issue where a client integration package is created for MQTTnet

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;

#pragma warning disable ASPIREATS001 // AspireExport is experimental

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer experimental, so not required

@@ -0,0 +1,61 @@
#pragma warning disable ASPIREATS001 // AspireExport is experimental

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required

@aaronpowell

Copy link
Copy Markdown
Member

@IgorShaposhnikov - if you can action this ASAP I'll include it in the 13.5.0 release that'll go out shortly

@IgorShaposhnikov

Copy link
Copy Markdown
Contributor Author

It might be worth having a follow-up issue where a client integration package is created for MQTTnet

Thanks for the idea! An MQTTnet client integration would be a cool future package. I probably won't be able to dive into it immediately, but let's keep it on the radar for later.

@aaronpowell
aaronpowell merged commit bccf73a into CommunityToolkit:main Aug 20, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Integration Component: CommunityToolkit.Aspire.Hosting.Mosquitto

2 participants