Commit 54a08b9781aceddb390d3893d9dc94873bea396a

Authored by YunaiV
1 parent 815f3843

feat:【IoT 物联网】application 配置文件合并

yudao-module-iot/yudao-module-iot-gateway/src/main/resources/application-local.yaml deleted
1 -# ==================== IoT 网关本地开发环境配置 ====================  
2 ---- #################### 消息队列相关 ####################  
3 -  
4 -# rocketmq 配置项,对应 RocketMQProperties 配置类  
5 -rocketmq:  
6 - name-server: 127.0.0.1:9876 # RocketMQ Namesrv  
7 -  
8 ---- #################### IoT 网关相关配置 ####################  
9 -  
10 -yudao:  
11 - iot:  
12 - # 网关配置  
13 - gateway:  
14 - # 设备 RPC 配置  
15 - rpc:  
16 - url: http://127.0.0.1:48080 # 主程序 API 地址  
17 - # 设备 Token 配置  
18 - token:  
19 - secret: yudaoIotGatewayTokenSecret123456789 # Token 密钥,至少32位  
20 -  
21 - # 协议配置  
22 - protocol:  
23 - # ====================================  
24 - # 针对引入的 HTTP 组件的配置  
25 - # ====================================  
26 - http:  
27 - enabled: true  
28 - server-port: 8092  
29 - # ====================================  
30 - # 针对引入的 EMQX 组件的配置  
31 - # ====================================  
32 - emqx:  
33 - enabled: false  
34 - http-port: 8090 # MQTT HTTP 服务端口  
35 - mqtt-host: 127.0.0.1 # MQTT Broker 地址  
36 - mqtt-port: 1883 # MQTT Broker 端口  
37 - mqtt-username: admin # MQTT 用户名  
38 - mqtt-password: public # MQTT 密码  
39 - mqtt-client-id: iot-gateway-mqtt # MQTT 客户端 ID  
40 - mqtt-ssl: false # 是否开启 SSL  
41 - mqtt-topics:  
42 - - "/sys/#" # 系统主题  
43 - # ====================================  
44 - # 针对引入的 TCP 组件的配置  
45 - # ====================================  
46 - tcp:  
47 - enabled: true  
48 - server-port: 8093  
49 - server-host: 0.0.0.0  
50 -  
51 - # 消息总线配置  
52 - message-bus:  
53 - type: redis # 本地开发使用 RocketMQ  
54 -  
55 ---- #################### 日志相关配置 ####################  
56 -  
57 -# 开发环境日志配置  
58 -logging:  
59 - level:  
60 - # 开发环境详细日志  
61 - cn.iocoder.yudao.module.iot.gateway.protocol.emqx: DEBUG  
62 - cn.iocoder.yudao.module.iot.gateway.protocol.http: DEBUG  
63 - # MQTT 客户端日志  
64 -# io.vertx.mqtt: DEBUG  
65 \ No newline at end of file 0 \ No newline at end of file
yudao-module-iot/yudao-module-iot-gateway/src/main/resources/application.yaml
@@ -8,6 +8,7 @@ spring: @@ -8,6 +8,7 @@ spring:
8 8
9 # rocketmq 配置项,对应 RocketMQProperties 配置类 9 # rocketmq 配置项,对应 RocketMQProperties 配置类
10 rocketmq: 10 rocketmq:
  11 + name-server: 127.0.0.1:9876 # RocketMQ Namesrv
11 # Producer 配置项 12 # Producer 配置项
12 producer: 13 producer:
13 group: ${spring.application.name}_PRODUCER # 生产者分组 14 group: ${spring.application.name}_PRODUCER # 生产者分组
@@ -16,14 +17,20 @@ rocketmq: @@ -16,14 +17,20 @@ rocketmq:
16 17
17 yudao: 18 yudao:
18 iot: 19 iot:
  20 + # 消息总线配置
  21 + message-bus:
  22 + type: redis # 消息总线的类型
  23 +
19 # 网关配置 24 # 网关配置
20 gateway: 25 gateway:
21 # 设备 RPC 配置 26 # 设备 RPC 配置
22 rpc: 27 rpc:
  28 + url: http://127.0.0.1:48080 # 主程序 API 地址
23 connect-timeout: 30s 29 connect-timeout: 30s
24 read-timeout: 30s 30 read-timeout: 30s
25 # 设备 Token 配置 31 # 设备 Token 配置
26 token: 32 token:
  33 + secret: yudaoIotGatewayTokenSecret123456789 # Token 密钥,至少32位
27 expiration: 7d 34 expiration: 7d
28 35
29 # 协议配置 36 # 协议配置
@@ -33,23 +40,28 @@ yudao: @@ -33,23 +40,28 @@ yudao:
33 # ==================================== 40 # ====================================
34 http: 41 http:
35 enabled: true 42 enabled: true
  43 + server-port: 8092
36 # ==================================== 44 # ====================================
37 # 针对引入的 EMQX 组件的配置 45 # 针对引入的 EMQX 组件的配置
38 # ==================================== 46 # ====================================
39 emqx: 47 emqx:
40 enabled: false 48 enabled: false
41 - mqtt-ssl: false 49 + http-port: 8090 # MQTT HTTP 服务端口
  50 + mqtt-host: 127.0.0.1 # MQTT Broker 地址
  51 + mqtt-port: 1883 # MQTT Broker 端口
  52 + mqtt-username: admin # MQTT 用户名
  53 + mqtt-password: public # MQTT 密码
  54 + mqtt-client-id: iot-gateway-mqtt # MQTT 客户端 ID
  55 + mqtt-ssl: false # 是否开启 SSL
42 mqtt-topics: 56 mqtt-topics:
43 - - "/sys/#" # 系统主题 57 + - "/sys/#" # 系统主题
44 # ==================================== 58 # ====================================
45 # 针对引入的 TCP 组件的配置 59 # 针对引入的 TCP 组件的配置
46 # ==================================== 60 # ====================================
47 tcp: 61 tcp:
48 - enabled: false  
49 -  
50 - # 消息总线配置  
51 - message-bus:  
52 - type: redis # 消息总线的类型 62 + enabled: true
  63 + server-port: 8093
  64 + server-host: 0.0.0.0
53 65
54 --- #################### 日志相关配置 #################### 66 --- #################### 日志相关配置 ####################
55 67
@@ -63,6 +75,11 @@ logging: @@ -63,6 +75,11 @@ logging:
63 org.springframework.boot: INFO 75 org.springframework.boot: INFO
64 # RocketMQ 日志 76 # RocketMQ 日志
65 org.apache.rocketmq: WARN 77 org.apache.rocketmq: WARN
  78 + # MQTT 客户端日志
  79 + # io.vertx.mqtt: DEBUG
  80 + # 开发环境详细日志
  81 + cn.iocoder.yudao.module.iot.gateway.protocol.emqx: DEBUG
  82 + cn.iocoder.yudao.module.iot.gateway.protocol.http: DEBUG
66 # 根日志级别 83 # 根日志级别
67 root: INFO 84 root: INFO
68 85