SpringBoot使用MQTT yaml配置参考 #4
Answered
by
wendy512
meggls2016
asked this question in
Q&A
-
|
能给一份SpringBoot使用MQTT yaml配置完整参考吗? |
Beta Was this translation helpful? Give feedback.
Answered by
wendy512
Sep 18, 2024
Replies: 1 comment
-
|
以下是完整配置,仅供参考 stream:
# 数据通道
channel:
# 接受通道
sourceQueue:
# 通道类型,目前支持:memory
type: memory
# 队列容量
capacity: 20000
# 发送通道
sinkQueue:
type: memory
# 队列容量
capacity: 20000
# 消息源配置
source:
test:
# 消息源类型,目前支持:local、mqtt、kafka、rabbitmq、redis、pulsar
type: mqtt
# 关联通道
channel: sourceQueue
# 指定实例名称
instance: mqtt-client-1
config:
topic: test/stream-1
# 为空默认为UUID生成
clientId: test1
# 接受本地通道的数据,然后发送到MQTT Server
test2:
type: local
channel: sinkQueue
# 消息目标配置
sink:
# 接受处理
test:
# 消息目标类型,目前支持:local、mqtt、kafka、rabbitmq、redis、pulsar
type: default
# 关联通道
channel: sourceQueue
# 目标由几个固定线程去处理
threads: 2
# 发送处理
test2:
type: mqtt
channel: sinkQueue
threads: 1
# 指定实例名称
instance: mqtt-client-1
config:
# 为空默认为UUID生成
clientId: test2
# 实例配置
instance:
mqtt-client-1:
host: tcp://youhost:1883
qos: 1
username: admin
password: public
autoReconnect: true
cleanSession: true
keepAlive: 60
connectionTimeout: 30
timeToWait: 60000
# ssl配置
ssl:
enabled: true
# 密钥路径,支持classpath:
keyStore: /path/key.jks
# 密钥类型
keyStoreType: JKS
# 密钥密码
keyStorePassword: password |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
meggls2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
以下是完整配置,仅供参考