-
Notifications
You must be signed in to change notification settings - Fork 145
ScriptingSubscriptions
Kamil Baczkowicz edited this page Oct 9, 2016
·
1 revision
To run a script for a given subscription, go to the connection settings (Menu -> Connections -> Connection settings / Ctrl + M), select your connection, then go to the Subscriptions tab and add a new entry with the subscription filter/topic and the location of the script. Then open the connection and your script should be run automatically.
function onMessage()
{
mqtt.publish(
"/reply", "<simpleReply><topic>" + receivedMessage.getTopic() + "</topic>"
+ "<payload><![CDATA[" + receivedMessage.getPayload() + "]]></payload>"
+ "</simpleReply>", 0, false);
return true;
}
function onMessage()
{
receivedMessage.setPayload("<tag>" + receivedMessage.getPayload() + "- modified :)</tag>");
return true;
}
mqtt-spy
- Getting started
- Overview
- Changelog
- Message search
- Charts
- Configuration
- Logging
- Dependencies
- Downloads
- FAQs
mqtt-spy-daemon
mqtt-spy & mqtt-spy-daemon