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 offers a ready-to-use Mosquitto MQTT cloud solution that provides a host of benefits, including:
- Unlimited message exchanges and transfers.
- Unlimited devices authentication via an external API.
- Advanced ACLs on topics, users and actions.
- Customizable domain name secured with HTTPS (for example, https://mqtt.your-company.com).
- Effortless updates with just a click.
- Optimal performance and robust security powered by a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Mosquitto MQTT cloud hosting solution!
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!