我有以下mosquitto.conf但是当互联网熄灭时,它不会缓冲并在互联网回来时发送到AWS IoT。
问题:
对于mosquitto配置我做错了什么,离线缓冲没有按预期工作?
我正在考虑在NodeJS上编写自己的桥。有关支持离线缓冲的NodeJS MQTT库的任何建议吗?
谢谢!
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
# =================================================================
# Bridges to AWS IOT
# =================================================================
# AWS IoT endpoint, use AWS CLI 'aws iot describe-endpoint'
connection awsiot
address aws.iot.us-west-2.amazonaws.com:8883
# Specifying which topics are bridged
topic outTopic out 1
# Setting protocol version explicitly
bridge_protocol_version mqttv311
bridge_insecure false
# Bridge connection name and MQTT client Id,
# enabling the connection automatically when the broker starts.
cleansession true
clientid bridgeawsiot
start_type automatic
notifications false
log_type all
cafile /home/pi/ca.crt
keyfile /home/pi/server.key
certfile /home/pi/server.crt
tls_version tlsv1
# =================================================================
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
#Path to the rootCA
bridge_cafile /home/pi/rootCA.cer
# Path to the PEM encoded client certificate
bridge_certfile /home/pi/bridge.cert.pem
# Path to the PEM encoded client private key
bridge_keyfile /home/pi/bridge.private.key
答案 0 :(得分:1)
网桥配置中的cleansession true
表示当网桥关闭时没有消息排队。