3
我正在使用mosquitto服務器作爲mqtt broker。我測試mosquitto的性能,我需要訂閱$ SYS層次結構的一些數據,如目前連接的數量從$SYS/broker/clients/active
主題。我有以下蚊子配置文件。Mosquitto未在SYS主題上發佈
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
listener 1884
protocol websockets
listener 1883
sys_interval 1
max_connections -1
我訂閱$SYS/broker/clients/active
話題這樣
[email protected]:/etc/mosquitto$ mosquitto_sub -d -t $SYS/broker/clients/active
Client mosqsub/28715-ip-172-31 sending CONNECT
Client mosqsub/28715-ip-172-31 received CONNACK
Client mosqsub/28715-ip-172-31 sending SUBSCRIBE (Mid: 1, Topic: /broker/clients/active, QoS: 0)
Client mosqsub/28715-ip-172-31 received SUBACK
Subscribed (mid: 1): 0
在配置文件中sys_interval
爲1,但我沒有收到以上認購任何更新。我也嘗試過訂閱一些替代主題,但仍未收到任何內容。 Mosquitto服務器託管在帶有Linux操作系統的AWS微型實例上。
是,它現在的工作。 –