Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js MOSQUITO缓冲不工作_Node.js_Raspberry Pi_Mqtt - Fatal编程技术网

Node.js MOSQUITO缓冲不工作

Node.js MOSQUITO缓冲不工作,node.js,raspberry-pi,mqtt,Node.js,Raspberry Pi,Mqtt,我有以下mosquito.conf,但当互联网断开时,它不会在互联网恢复时缓冲并发送到AWS物联网 问题: 我对mosquitto配置做了什么错误,离线缓冲没有按预期工作 我正在考虑在NodeJS上写我自己的桥。对支持离线缓冲的NodeJS MQTT库有什么建议吗 谢谢大家! pid_file /var/run/mosquitto.pid persistence true persistence_location /var/lib/mosquitto/ log_dest file /var/

我有以下mosquito.conf,但当互联网断开时,它不会在互联网恢复时缓冲并发送到AWS物联网

问题:

我对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

网桥配置中的cleansession true表示网桥关闭时没有消息排队。

我意识到我执行cleansession=true的原因,因为AWS IoT仅支持cleansession=true。有保留本地缓存的替代方案吗?仅仅因为另一端的代理AWT不支持消息队列,并不意味着您必须在您的端强制执行它。如果从配置中删除该标志,则应将其在pi上排队以发送给AWS