emq的客户端与服务端_EMQ ---客户端上线自动订阅主题

通过修改配置文件即可实现。

emq v2.3.11,软件架构做了调整,把功能集成在了emq_modules模块,/data/loaded_plugins默认会加载emq_modules。

我们只需要改动配置文件emqx-rel-2.3.11/deps/emq_modules/etc/emq_modules.conf

##--------------------------------------------------------------------

## Subscription Module

##--------------------------------------------------------------------

## Enable Subscription Module.

##

## Value: on | off

module.subscription = on

## Subscribe the Topics automatically when client connected.

module.subscription.1.topic = %c/w

## Qos of the subscription: 0 | 1 | 2

把module.subscription设置为on,

把module.subscription.1.topic设置为%c/w,%c是通配符,会自动切换成clientId。注意是%c,而不是$c。

原文:https://www.cnblogs.com/saryli/p/9785713.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值