From 4065392ccce8207e4bbeb18bcd3ba96523920af6 Mon Sep 17 00:00:00 2001 From: kerwincui <164770707@qq.com> Date: Mon, 31 Mar 2025 17:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=90=8E=E7=AB=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fastbee/mqttclient/MqttClientConfig.java | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/springboot/fastbee-plugs/fastbee-mqtt-client/src/main/java/com/fastbee/mqttclient/MqttClientConfig.java b/springboot/fastbee-plugs/fastbee-mqtt-client/src/main/java/com/fastbee/mqttclient/MqttClientConfig.java index 8ac01f05..4dc0bcc1 100644 --- a/springboot/fastbee-plugs/fastbee-mqtt-client/src/main/java/com/fastbee/mqttclient/MqttClientConfig.java +++ b/springboot/fastbee-plugs/fastbee-mqtt-client/src/main/java/com/fastbee/mqttclient/MqttClientConfig.java @@ -1,16 +1,28 @@ package com.fastbee.mqttclient; +import com.fastbee.common.utils.uuid.UUID; import lombok.Data; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; -/** mqtt配置信息*/ +/** + * mqtt配置信息 + */ @Data @Component -@ConfigurationProperties(prefix = "spring.mqtt") public class MqttClientConfig { + public MqttClientConfig() { + this.username = "fastbee"; + this.password = "fastbee"; + this.hostUrl = "tcp://127.0.0.1:1883"; + this.clientId = UUID.randomUUID().toString(); + this.defaultTopic = "test"; + this.timeout = 30; + this.keepalive = 30; + this.clearSession = true; + } /** * 用户名 @@ -41,11 +53,17 @@ public class MqttClientConfig { */ private int keepalive; - /**是否清除session*/ + /** + * 是否清除session + */ private boolean clearSession; - /**是否共享订阅*/ + /** + * 是否共享订阅 + */ private boolean isShared; - /**分组共享订阅*/ + /** + * 分组共享订阅 + */ private boolean isSharedGroup; /**