Commit de198fc6 authored by Riccardo Presotto's avatar Riccardo Presotto

set mqtt sub sync

parent 97fdc3a7
REST_MQTT_example
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
......
REST/beans/Users.java
REST.beans.Users
REST/StartServer.java
REST.StartServer
REST/beans/User.java
REST.beans.User
REST/services/HelloWorld.java
REST.services.HelloWorld
REST/services/UsersService.java
REST.services.UsersService
REST/StartServer.java
REST.StartServer
REST/beans/Users.java
REST.beans.Users
MQTT/PubExample.java
PubExample
MQTT.PubExample
MQTT/SubExample.java
SubExample
SubExample$1
MQTT.SubExample
MQTT.SubExample$1
......@@ -18,14 +18,13 @@ public class SubExample {
try {
// Create an Mqtt client
MqttAsyncClient mqttClient = new MqttAsyncClient(broker, clientId);
MqttClient mqttClient = new MqttClient(broker, clientId);
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setCleanSession(true);
// Connect the client
System.out.println(clientId + " Connecting to " + broker);
IMqttToken token = mqttClient.connect(connOpts);
token.waitForCompletion();
mqttClient.connect(connOpts);
System.out.println(clientId + " Connected");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment