Skip to content

Adding module mosquitto#1390

Open
ChxGuillaume wants to merge 3 commits into
testcontainers:mainfrom
ChxGuillaume:feat/mosquitto-module
Open

Adding module mosquitto#1390
ChxGuillaume wants to merge 3 commits into
testcontainers:mainfrom
ChxGuillaume:feat/mosquitto-module

Conversation

@ChxGuillaume

Copy link
Copy Markdown

Add Mosquitto module

This PR introduces a new @testcontainers/mosquitto module for the Eclipse Mosquitto MQTT broker, following the same structure as the existing HiveMQ module.

What's included

  • MosquittoContainer — starts an eclipse-mosquitto:2 container with a custom config injected at startup, since Mosquitto 2.x disallows anonymous connections by default
  • Anonymous mode (allow_anonymous true) out of the box
  • Authenticated mode via withUsername() / withPassword() — creates the password file using mosquitto_passwd -b before launching the broker, with a chown to fix ownership since Mosquitto drops privileges to the mosquitto user
  • StartedMosquittoContainer.getPort() and getConnectionString() — the latter includes credentials in the URL when auth is configured
  • Two test files (mosquitto-container.test.ts and mosquitto-container-auth.test.ts) kept separate to avoid a codeinclude block-name collision between mosquittoConnect and mosquittoConnectWithCredentials
  • Documentation at docs/modules/mosquitto.md with codeinclude examples for both usage patterns, added to the mkdocs navigation

…up log matching, upgrade to Mosquitto 2 base image, and fix file permissions during setup.
…o a dedicated file and updated related documentation references.
@netlify

netlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit fcc2a86
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/6a413312c8185c00089b9d35
😎 Deploy Preview https://deploy-preview-1390--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant