Commit 54a08b9781aceddb390d3893d9dc94873bea396a
1 parent
815f3843
feat:【IoT 物联网】application 配置文件合并
Showing
2 changed files
with
24 additions
and
71 deletions
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 | 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 | 8 | |
| 9 | 9 | # rocketmq 配置项,对应 RocketMQProperties 配置类 |
| 10 | 10 | rocketmq: |
| 11 | + name-server: 127.0.0.1:9876 # RocketMQ Namesrv | |
| 11 | 12 | # Producer 配置项 |
| 12 | 13 | producer: |
| 13 | 14 | group: ${spring.application.name}_PRODUCER # 生产者分组 |
| ... | ... | @@ -16,14 +17,20 @@ rocketmq: |
| 16 | 17 | |
| 17 | 18 | yudao: |
| 18 | 19 | iot: |
| 20 | + # 消息总线配置 | |
| 21 | + message-bus: | |
| 22 | + type: redis # 消息总线的类型 | |
| 23 | + | |
| 19 | 24 | # 网关配置 |
| 20 | 25 | gateway: |
| 21 | 26 | # 设备 RPC 配置 |
| 22 | 27 | rpc: |
| 28 | + url: http://127.0.0.1:48080 # 主程序 API 地址 | |
| 23 | 29 | connect-timeout: 30s |
| 24 | 30 | read-timeout: 30s |
| 25 | 31 | # 设备 Token 配置 |
| 26 | 32 | token: |
| 33 | + secret: yudaoIotGatewayTokenSecret123456789 # Token 密钥,至少32位 | |
| 27 | 34 | expiration: 7d |
| 28 | 35 | |
| 29 | 36 | # 协议配置 |
| ... | ... | @@ -33,23 +40,28 @@ yudao: |
| 33 | 40 | # ==================================== |
| 34 | 41 | http: |
| 35 | 42 | enabled: true |
| 43 | + server-port: 8092 | |
| 36 | 44 | # ==================================== |
| 37 | 45 | # 针对引入的 EMQX 组件的配置 |
| 38 | 46 | # ==================================== |
| 39 | 47 | emqx: |
| 40 | 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 | 56 | mqtt-topics: |
| 43 | - - "/sys/#" # 系统主题 | |
| 57 | + - "/sys/#" # 系统主题 | |
| 44 | 58 | # ==================================== |
| 45 | 59 | # 针对引入的 TCP 组件的配置 |
| 46 | 60 | # ==================================== |
| 47 | 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 | 75 | org.springframework.boot: INFO |
| 64 | 76 | # RocketMQ 日志 |
| 65 | 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 | 84 | root: INFO |
| 68 | 85 | ... | ... |