46 lines
2.3 KiB
YAML
Raw Normal View History

2026-06-12 16:14:58 +08:00
# 服务器配置
server:
port: 8290
undertow:
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
buffer-size: 1024
# 是否分配的直接内存
direct-buffers: true
# 线程配置
threads:
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
io: 16
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
worker: 400
servlet:
# 编码配置
encoding:
charset: UTF-8
force: true
# MQTT服务端配置
mqtt:
server:
enabled: true # 是否开启服务端默认true
port: 11883 # 端口默认1883
name: Blade-MQTT-Broker # 名称默认Mica-Mqtt-Server
heartbeat-timeout: 120000 # 心跳超时,单位毫秒,默认: 1000 * 120
read-buffer-size: 8KB # 接收数据的 buffer size默认8k
max-bytes-in-message: 10MB # 消息解析最大 bytes 长度默认10M
auth:
enable: false # 是否开启 mqtt 认证
debug: true # 如果开启 prometheus 指标收集建议关闭
stat-enable: true # 开启指标收集debug 和 prometheus 开启时需要打开,默认开启,关闭节省内存
web-port: 28083 # http、websocket 端口默认8083
websocket-enable: true # 是否开启 websocket默认 true
http-enable: false # 是否开启 http api默认 false
ssl: # mqtt tcp ssl 认证
enabled: false # 是否开启 ssl 认证2.1.0 开始支持双向认证
keystore-path: # 必须参数ssl keystore 目录,支持 classpath:/ 路径。
keystore-pass: # 必选参数ssl keystore 密码
truststore-path: # 可选参数ssl 双向认证 truststore 目录,支持 classpath:/ 路径。
truststore-pass: # 可选参数ssl 双向认证 truststore 密码
client-auth: none # 是否需要客户端认证双向认证默认NONE不需要
auth:
timeSecondDiff: 300 # 认证时间差默认5分钟