java mqtt
代码: package cc.gongchang.mqtt; import java.net.URISyntaxException; import org.fusesource.hawtdispatch.Dispatch; import org.fusesource.mqtt.client.Future; import org.fusesource.mqtt.client.FutureConnection; import org.fusesource.mqtt.client.MQTT; import org.fusesource.mqtt.client.Message; import org.fusesource.mqtt.client.QoS; import org.fusesource.mqtt.client.Topic; import com.alibaba.fastjson.JSONObject; /** * Hello world! * */ public class App { public static void main(String[] args) { MQTT mqtt = new MQTT(); // MQTT设置说明 // 设置主机号 try { mqtt.setHost("tcp://sgdzpic.3322.org:1883"); } catch