Mosquitto: Testing the Mosquitto bridge configuration

This documentation is part of the Bridges guide. View the full guide here: How to connect Mosquitto servers together (bridge).

👋 Welcome to the Stackhero documentation!

Stackhero gives you a fully managed Mosquitto MQTT cloud environment designed for reliability and flexibility:

  • Unlimited message throughput and data transfers, so your workflows never hit artificial limits.
  • Unlimited device authentication through your own external API, making onboarding and access management seamless.
  • Advanced ACLs for fine-grained control over topics, users, and actions.
  • A custom domain name with built-in HTTPS for secure, branded endpoints (for example: https://mqtt.your-company.com).
  • Zero-hassle updates: apply improvements or security patches with a single click.
  • Consistent performance and strong security, with every instance running on a private, dedicated infrastructure.

Accelerate your IoT projects and reduce operational overhead. You can have a secure, production-ready Mosquitto MQTT cloud hosting instance up and running in just a few minutes.

Mosquitto does not provide extensive logs to verify that your bridge is working.

The best way to ensure its functionality is to test it directly.

You can connect to your remote server and subscribe to the testBridge topic using an existing user (and password) declared on the remote server:

mosquitto_sub -h 127.0.0.1 -u <user> -P <password> -t "testBridge" -v

In another terminal, you can connect to your Stackhero Mosquitto instance using an existing user (and password) declared on your Stackhero Mosquitto instance:

mosquitto_sub -h <XXXXXX>.stackhero-network.com -p <PORT_TLS> -u <user> -P <password> -t "testBridge" -v

Open a third terminal and send a test message using your Stackhero instance (and a corresponding user):

mosquitto_pub -h <XXXXXX>.stackhero-network.com -p <PORT_TLS> -u <user> -P <password> -t "testBridge" -m "Message from Stackhero broker"

You should see the "Message from Stackhero broker" on your first two terminals.

Finally, send a test message using your remote Mosquitto instance:

mosquitto_pub -h 127.0.0.1 -u <user> -P <password> -t "testBridge" -m "Message from remote broker"

Congratulations! You now have your two MQTT servers connected securely, with authentication and encryption!