mqtt对接嵌入式
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||
@@ -9,7 +10,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
public class DromaraApplication {
|
||||
|
||||
@@ -17,7 +18,7 @@ public class DromaraApplication {
|
||||
SpringApplication application = new SpringApplication(DromaraApplication.class);
|
||||
application.setApplicationStartup(new BufferingApplicationStartup(2048));
|
||||
application.run(args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ water-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
||||
log.info("(♥◠‿◠)ノ゙ water-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,30 +20,53 @@ server:
|
||||
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
|
||||
worker: 256
|
||||
--- # mqtt配置信息
|
||||
--- # mqtt配置信息
|
||||
mqtt:
|
||||
enabled: ${MQTT_ENABLED:true}
|
||||
broker-url: ssl://service.reinkun.com:8883
|
||||
username: admin
|
||||
password: yukun_mqtt
|
||||
client-id: dm-server-${random.int[1000,9999]}
|
||||
client-id: water-server-${server.port}
|
||||
qos: 1
|
||||
keep-alive: 60
|
||||
connection-timeout: 30
|
||||
max-inflight: 5000
|
||||
clean-session: false
|
||||
automatic-reconnect: true
|
||||
async:
|
||||
core-pool-size: 16
|
||||
max-pool-size: 64
|
||||
consumer-count: 16
|
||||
queue-capacity: 20000
|
||||
batch-size: 100
|
||||
offer-timeout-ms: 50
|
||||
poll-timeout-ms: 100
|
||||
tls:
|
||||
enabled: true
|
||||
skip-verify: true
|
||||
skip-verify: false
|
||||
command-ack:
|
||||
enabled: true
|
||||
max-retry-count: 3
|
||||
retry-interval-ms: 5000
|
||||
scan-interval-ms: 5000
|
||||
pending-ttl-seconds: 86400
|
||||
ack-ttl-seconds: 86400
|
||||
pending-key-prefix: "mqtt:command:pending:"
|
||||
ack-key-prefix: "mqtt:command:ack:"
|
||||
pending-set-key: "mqtt:command:pending:ids"
|
||||
device-status-cache-prefix: "mqtt:device:status:"
|
||||
device-status-cache-ttl-seconds: 300
|
||||
topics:
|
||||
subscribe:
|
||||
|
||||
- /publish/+/error
|
||||
- /publish/deviceInfo
|
||||
- /publish/finish/schedule
|
||||
- /publish/finish/key
|
||||
- /publish/schedule/canceled
|
||||
- /subscriber/+/schedule
|
||||
- /subscriber/+/cancel
|
||||
- /subscriber/+/key
|
||||
publish-prefix: /water
|
||||
- /+/publish/finish/schedule #排程任务完成上报
|
||||
- /+/publish/register #设备注册
|
||||
- /+/publish/power #电量
|
||||
- /+/publish/ack #应答
|
||||
- /+/publish/finish/key #按键浇水完成
|
||||
- /+/publish/error #硬件故障
|
||||
# - /+/subscriber/cmd #下发命令 0关闭浇水 1开始浇水
|
||||
|
||||
publish-prefix: ""
|
||||
captcha:
|
||||
# 是否启用验证码校验
|
||||
enable: true
|
||||
@@ -124,8 +147,8 @@ sa-token:
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# jwt秘钥
|
||||
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
|
||||
# jwt秘钥(生产环境务必通过环境变量覆盖此弱默认值)
|
||||
jwt-secret-key: ${SA_TOKEN_JWT_SECRET_KEY:abcdefghijklmnopqrstuvwxyz}
|
||||
|
||||
# security配置
|
||||
security:
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
|
||||
<queueSize>512</queueSize>
|
||||
<queueSize>8192</queueSize>
|
||||
<!-- 添加附加的appender,最多只能添加一个 -->
|
||||
<appender-ref ref="file_info"/>
|
||||
</appender>
|
||||
@@ -92,7 +92,7 @@
|
||||
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
|
||||
<queueSize>512</queueSize>
|
||||
<queueSize>8192</queueSize>
|
||||
<!-- 添加附加的appender,最多只能添加一个 -->
|
||||
<appender-ref ref="file_error"/>
|
||||
</appender>
|
||||
|
||||
Reference in New Issue
Block a user