emqx配置代理订阅无效
emqx版本:4.1-beta.2
每次emqx一个大本版升级,之前的配置文件和api都会改动,因此该问题只针对上述版本
参照官网最新文档,按如下规则配置:
module.subscription = on
module.subscription.1.topic = cmd/%u/+/+/+/#
module.subscription.1.qos = 1
module.subscription.2.topic = rpc/%u/+/+/+/#
module.subscription.2.qos = 1
module.subscription.3.topic = m2m/%u/+/+
module.subscription.3.qos = 1
接在在服务器输入命令:emqx restart
,服务器显示如下:
[root@wanli ~]# emqx restart
EMQ X Broker v4.1-beta.2 is stoped: ok
EMQ X Broker v4.1-beta.2 failed to start within 15 seconds,
see the output of '/usr/bin/emqx console' for more information.
If you want to wait longer, set the environment variable
WAIT_FOR_ERLANG to the number of seconds to wait.
输入/usr/bin/emqx console
查看原因:
[root@wanli ~]# /usr/bin/emqx console
2020-05-11T09:52:06.888911+08:00 [error] You've tried to set module.subscription, but there is no setting with that name.
2020-05-11T09:52:06.889050+08:00 [error] Did you mean one of these?
2020-05-11T09:52:06.919048+08:00 [error] module.subscription.$id.nl
2020-05-11T09:52:06.919176+08:00 [error] module.subscription.$id.rh
2020-05-11T09:52:06.919255+08:00 [error] module.subscription.$id.qos
2020-05-11T09:52:06.941290+08:00 [error] Error generating con
可知emqx-4.1-beta.2
已经不支持module.subscription = off | on
配置,于是在emqx.conf文件中去掉module.subscription = on
,接着重启emqx
[root@wanli ~]# emqx restart
Node 'emqx@127.0.0.1' not responding to pings.
EMQ X Broker v4.1-beta.2 is stoped:
EMQ X Broker v4.1-beta.2 is started successfully!
这下没问题了,用MQTTX客户端连接试一下:
由图可知,配置规则无效,按照官网文档,输入命令
[root@wanli ~]# emqx_ctl subscriptions list
[root@wanli ~]#
从结果可知,配置规则并未生效,在Dashboard界面看到一个Subscriptions选项卡,点开看看,有个emqx_mod_subscription配置,联想到module.subscription = on
无效,于是启用该模块:
再次重启emqx
[root@wanli ~]# emqx restart
EMQ X Broker v4.1-beta.2 is stoped: ok
EMQ X Broker v4.1-beta.2 is started successfully!
并用mqttx客户端连接重试上述步骤,结果依旧无效。
问题:请问在emqx-4.1-beta.2如何配置代理订阅???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论