‘liusuyi’
2023-07-05 1fd64b07ddb99c2d9cc8a358b71aceb6a2c81492
src/main/java/com/ard/utils/mqtt/MqttConsumer.java
@@ -75,7 +75,7 @@
        // 设置会话心跳时间
        options.setKeepAliveInterval(PropertiesUtil.MQTT_KEEP_ALIVE);
        // 是否清除session
        options.setCleanSession(false);
        options.setCleanSession(true);
        log.info("--生成mqtt配置对象");
        return options;
    }
@@ -165,9 +165,9 @@
                log.info("消息发送成功");
            }
        } catch (MqttPersistenceException e) {
            e.printStackTrace();
            log.error("mqtt持久异常:" + e.getMessage());
        } catch (MqttException e) {
            e.printStackTrace();
            log.error("mqtt异常:" + e.getMessage());
        }
    }
}