EMQX的NSQ桥接插件
基于4.2.14版本的EMQX和ENSQ进行开发
This is a plugin for the EMQ X broker and nsq.
Develop based on EMQX(version 4.2.14) and ENSQ
Config Path:
etc/plugins/emqx_bridge_nsq.config
[
{emqx_bridge_nsq,
[{values, [
{bootstrap_broker, "localhost"},
{nsq_producer_topic, data_topic},
{nsq_producer_topic2, device_status}
]}
]}
].
bootstrap_broker : host of nsqlookupd
nsq_producer_topic : topic name(for data)
nsq_producer_topic2 : topic name(for device_status)
Start the topic name with lowercase like tOPIC
When MQTT publish a message
"type":"published",
"topic":"06cf442d-2f6b-72a7-85f7-2fc8423abba6/Pub",
"from":"06cf442d-2f6b-72a7-85f7-2fc8423abba6",
"payload":"{\"temp\": 27578,\"humi\": 56759,\"tvoc\": 7,\"co2\": 459,\"voci\": 101,\"pm1\": 20,\"pm2dot5\": 30,\"pm10\": 33,\"co\": 625,\"ch2o\": 12060}"
When MQTT disconnect
"type":"disconnected",
"device_id":"06cf442d-2f6b-72a7-85f7-2fc8423abba6",
"username":"emqx",
"reason":"normal"
For more information on disconnect reason
, see EMQX documentation
Apache License Version 2.0
izum1