The MQTT Broker service provides an mqtt broker and publisher for inter-container commmunication.
This service is configured to use password-based authentication. By default, the username is set to mqtt
and the password is password
. To customize these attributes, please set these environment variables.
export MQTT_USERNAME=<desired-username>
export MQTT_PASSWORD=<desired-password>
mosquitto_pub [-d] [-h host] [-p port] {-f file | -m message} [-t topic] [-u username] [-P password]
Name | Description |
---|---|
-h | host name |
-d | put the broker into the background after starting |
-p | publish on the specified port |
-f | send the contents of a file as the message |
-m | message payload to send |
-t | mqtt topic to publish to |
-u | mqtt username |
-P | mqtt password |
mosquitto_sub [-h host] [-p port] [-t topic] [-u username] [-P password]
Name | Description |
---|---|
-h | host name |
-p | subscribe on the specified port |
-t | mqtt topic to subscribe to |
-u | mqtt username |
-P | mqtt password |