Browse Source

限制mqtt重连频率

develop
lau572 3 days ago
parent
commit
cedaba7875
  1. 8
      zc-business/src/main/java/com/zc/business/controller/SideSlopeController.java

8
zc-business/src/main/java/com/zc/business/controller/SideSlopeController.java

@ -319,8 +319,14 @@ public class SideSlopeController extends BaseController {
logger.info("边坡监测mqtt开始监听" + topicName); logger.info("边坡监测mqtt开始监听" + topicName);
} catch (MqttException e) { } catch (MqttException e) {
logger.warn("边坡监测mqtt连接异常"); logger.warn("边坡监测mqtt连接异常",e);
scheduler.schedule(() -> {
try {
mqttSubscription(); mqttSubscription();
} catch (Exception exception) {
throw new RuntimeException(exception);
}
}, UniversalEnum.TEN.getNumber(), TimeUnit.SECONDS);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

Loading…
Cancel
Save