Skip to content

Instantly share code, notes, and snippets.

@xAPPO
xAPPO / mqttclient.groovy
Created November 9, 2018 02:12 — forked from magnuspalmer/mqttclient.groovy
Groovy mqtt client bluemix IoT services
@Grab(group='org.eclipse.paho', module='mqtt-client', version='0.4.0')
import org.eclipse.paho.client.mqttv3.*
import org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence
String tmpDir = System.getProperty("java.io.tmpdir")
MqttDefaultFilePersistence dataStore = new MqttDefaultFilePersistence("${tmpDir}/mqtt")
//org
String org = 'myOrg'