From cedaba787580ba1a312b573aef3a94f35860e40a Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Sat, 23 Nov 2024 16:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6mqtt=E9=87=8D=E8=BF=9E?= =?UTF-8?q?=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/controller/SideSlopeController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/SideSlopeController.java b/zc-business/src/main/java/com/zc/business/controller/SideSlopeController.java index 367a4cb2..f3710aba 100644 --- a/zc-business/src/main/java/com/zc/business/controller/SideSlopeController.java +++ b/zc-business/src/main/java/com/zc/business/controller/SideSlopeController.java @@ -319,8 +319,14 @@ public class SideSlopeController extends BaseController { logger.info("边坡监测mqtt开始监听" + topicName); } catch (MqttException e) { - logger.warn("边坡监测mqtt连接异常"); - mqttSubscription(); + logger.warn("边坡监测mqtt连接异常",e); + scheduler.schedule(() -> { + try { + mqttSubscription(); + } catch (Exception exception) { + throw new RuntimeException(exception); + } + }, UniversalEnum.TEN.getNumber(), TimeUnit.SECONDS); } } catch (Exception e) { e.printStackTrace();