Moved read authorization check from publish phase to subscribe

This commit is contained in:
andsel
2016-01-30 17:22:17 +01:00
parent 69c1219f2b
commit a19af18a61
4 changed files with 38 additions and 11 deletions
+1 -2
View File
@@ -2,9 +2,7 @@
import org.fusesource.mqtt.client.BlockingConnection
import org.fusesource.mqtt.client.MQTT
import org.fusesource.mqtt.client.Message
import org.fusesource.mqtt.client.QoS
import org.fusesource.mqtt.client.Topic
String host = args[0]
@@ -12,6 +10,7 @@ String topic = "/topic"
if (args.length > 1) {
topic = args[1]
}
println "publish script to topic ${topic} on host ${host}"
//start a publisher
MQTT mqtt2 = new MQTT()
mqtt2.setHost(host, 1883)