Publish message to MQTT

Demo app showing how to publish message to MQTT from Qlik Sense load script.

Load script

Assuming the .qvs helper subs are used, only one line of script is needed to publish a MQTT message.

The demo app does a bit more. First it posts a startup message to MQTT, then it loads some data and finally an all-done message is sent:

// -------------------------------------------
// Publish a MQTT message, load some data and publish another message
Call PostToMQTT('butler/5.0/demo-reloading/status', 'reload started')

// Load some data
Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;

// Publish final message
Call PostToMQTT('butler/5.0/demo-reloading/status', 'reload done')

The MQTT messages look like this in the MQTT Explorer app on mac OS:

alt text

The demo app is available in the GitHub repository.

Seeing is believing

The video below is available at Ptarmigan Labs' YouTube channel and also in the Butler playlist.

Last modified 2021-04-22: First commit (c105eb7)