Automation Events Over MQTT

It looks like the easiest way to send messages from various apps to RabbitMQ, is to use an MQTT command line client.

Installation

Command Line client

To be installed on each application server. Based on https://mqttx.app/cli

On X64 computers:

curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.9.6/mqttx-cli-linux-x64
sudo install ./mqttx-cli-linux-x64 /usr/local/bin/mqttx

On ARM computers:

curl -LO https://www.emqx.com/en/downloads/MQTTX/v1.9.6/mqttx-cli-linux-arm64
sudo install ./mqttx-cli-linux-arm64 /usr/local/bin/mqttx

Enabling MQTT on RabbitMQ server

Based on https://www.rabbitmq.com/mqtt.html

Going to test by just issueing rabbitmq-plugins enable rabbitmq_web_mqtt, but will need to do something better to preserve plugins after a docker image upgrade. Two possibilities, create volumes for enabled plugins (see link) or create custom Dockerfile - see https://stackoverflow.com/questions/52819237/how-to-add-plugin-to-rabbitmq-docker-image.