subscriptions 命令

subscriptions 命令查询消息服务器的订阅 (Subscription) 表。

命令描述
subscriptions list列出所有订阅
subscriptions show <ClientId>查询指定 ClientId 客户端的订阅
subscriptions add <ClientId> <Topic> <QoS>手动添加静态订阅
subscriptions del <ClientId> <Topic>手动删除静态订阅

subscriptions list

列出所有订阅:

  1. $ ./bin/emqx_ctl subscriptions list
  2. mosqsub/91042-airlee.lo -> t/y:1
  3. mosqsub/90475-airlee.lo -> t/+/x:2

subscriptions show

查询某个 Client 的订阅:

  1. $ ./bin/emqx_ctl subscriptions show 'mosqsub/90475-airlee.lo'
  2. mosqsub/90475-airlee.lo -> t/+/x:2

subscriptions add

手动添加订阅关系:

  1. $ ./bin/emqx_ctl subscriptions add 'mosqsub/90475-airlee.lo' '/world' 1
  2. ok

subscriptions del

手动删除订阅关系:

  1. $ ./bin/emqx_ctl subscriptions del 'mosqsub/90475-airlee.lo' '/world'
  2. ok