Scripted MQTT traffic with MQTT.fx MQTT.fx uses GraalVM 22.0 as JavaScript Engine. GraalVM is fully compatible with ECMAScript 202x, see: https://www.graalvm.org/22.0/reference-manual/js/JavaScriptCompatibility/ Bindings Within the script you can use the folling bindings to MQTT.fx Publish, Subscribe, Unsubscribe: mqttManager.publish(String topic, String messageBody) { mqttManager.publish(String topic, String messageBody, int qos) { mqttManager.publish(String topic, String messageBody, int qos, boolean retained) { mqttManager.subscribe(String topicFilter) { mqttManager.subscribe(String topicFilter, int qos) { mqttManager.unsubscribe(String topicFilter) { Script Actions: script.sleep(Long millis); script.setExitCode(int exitCode); script.setExitCodeOk(); script.setResultText(String message); Output to console: output.print(String message); Logging: logger.debug(String message); logger.info(String message); logger.error(String message); logger.warn(String message); logger.trace(String message); Adding new scripts New scripts can be easily made available for execution via the UI. The app is scanning a folder named “scripts” located at the MQTT.fx working directory: OS X: [USER_HOME]/Library/Application Support/MQTT-FX/scripts Windows: [USER_HOME]\AppData\Local\MQTT-FX\scripts Linux: [USER_HOME]/MQTT-FX/scripts If this folder does not exists it is created by MQTT.fx containing a demo script. Scripts are loaded from this folder at apllication start-up and can be reloaded via the reload button on MQTT.fx "Scripts" tab. Naming convention: [INDEX]__[NAME].js e.g: 01__Switch_Fountain_Test.js [INDEX] - controls the order of the entry in the drop down menu __ - delimiter between index and name [NAME] - the name of the menu entry (words are delimit by '_')