| | |
| | | mqttConnOpt.setAutomaticReconnect(false);//设置是否自动重连 |
| | | |
| | | //遗嘱消息 TODO qos2需要在设备上线时做清除消息操作 |
| | | mqttConnOpt.setWill("downline", ("我是" + mqttName + "_" + mqttClientId + ",我下线了").getBytes(), 2, false); |
| | | //mqttConnOpt.setWill("downline", ("我是" + mqttName + "_" + mqttClientId + ",我下线了").getBytes(), 2, false); |
| | | try { |
| | | |
| | | MqttClient mqttClient = new MqttClient(broker, mqttClientId, persistence); |
| | |
| | | String clientid = obj.getString("clientid"); |
| | | item.put("clientid", clientid); |
| | | //TODO 校验租户id是否存在 |
| | | |
| | | |
| | | if(!clientid.matches("^[^-]+-[^-]+-[^-]+$")) continue; |
| | | //username |
| | | item.put("username", obj.get("username")); |