Modules 模块

Modules 模块

EMQ X 支持模块扩展,默认三个模块,分别为上下线消息状态发布模块、代理订阅模块、主题(Topic)重写模块。

上下线消息状态发布模块

是否启动上下线消息状态发布模块:

module.presence = on

上下线消息状态发布模块发布 MQTT 消息时使用的 QoS:

module.presence.qos = 1

代理订阅模块

是否启动代理订阅模块:

module.subscription = off

客户端连接时自动订阅的主题与 QoS:

## Subscribe the Topics's qos
## module.subscription.1.topic = $client/%c
## module.subscription.1.qos = 0
## module.subscription.2.topic = $user/%u
## module.subscription.2.qos = 1

主题重写模块

是否启动主题重写模块:

module.rewrite = off

主题重写规则:

## module.rewrite.rule.1 = x/# ^x/y/(.+)$ z/y/$1
## module.rewrite.rule.2 = y/+/z/# ^y/(.+)/z/(.+)$ y/z/$2