bridges 命令
bridges 命令用于在多台 EMQ X 服务器节点间创建桥接:
--------- ---------
Publisher --> | node1 | --Bridge Forward--> | node2 | --> Subscriber
--------- ---------
bridges list | 查询全部桥接 |
---|---|
bridges start <Name> | 开启一个桥接 |
bridges stop <Name> | 停止一个桥接 |
bridges forwards <Name> | 列出指定 bridge 的转发主题 |
bridges add-forward <Name> <Topic> | 向指定 bridge 添加转发主题 |
bridges del-forward <Name> <Topic> | 从指定 bridge 删除转发主题 |
bridges subscriptions <Name> | 列出指定 bridge 的订阅主题 |
bridges add-subscription <Name> <Topic> <QoS> | 向指定 bridge 添加订阅主题 |
bridges del-subscription <Name> <Topic> | 从指定 bridge 删除订阅主题 |
关于 bridges 的配置项在 emqx/emqx.config 文件内。
bridges list
查询全部桥接:
$ ./bin/emqx_ctl bridges list
name: emqx status: Stopped
bridges start <Name>
开启一个桥接:
$ ./bin/emqx_ctl bridges start emqx
Start bridge successfully.
bridges stop <Name>
停止一个桥接:
$ ./bin/emqx_ctl bridges stop emqx
Stop bridge successfully.
bridges forwards <Name>
列出指定 bridge 的转发主题:
$ ./bin/emqx_ctl bridges forwards emqx
topic: sensor/#
bridges add-forward <Name> <Topic>
向指定 bridge 添加转发主题:
$ ./bin/emqx_ctl bridges add-forward emqx device_status/#
Add-forward topic successfully.
bridges del-forward <Name> <Topic>
从指定 bridge 删除转发主题:
$ ./bin/emqx_ctl bridges del-forward emqx device_status/#
Del-forward topic successfully.
bridges add-subscription <Name> <Topic> <QoS>
向指定 bridge 添加订阅主题:
$ ./bin/emqx_ctl bridges add-subscription emqx cmd/topic 1
Add-subscription topic successfully.
bridges subscriptions <Name>
列出指定 bridge 的订阅:
$ ./bin/emqx_ctl bridges subscriptions emqx
topic: cmd/topic, qos: 1
bridges del-subscription <Name> <Topic>
从指定 bridge 删除订阅主题:
$ ./bin/emqx_ctl bridges del-subscription emqx cmd/topic
Del-subscription topic successfully.