0

在 EMQX 软件中,如果我使用“web_hook 插件”并尝试选择 Advanced Config,如果我选择 web hook 仅用于接收到的消息,则需要填写两个字段:

+--------------------------------------------+
|  web.hook.rule.message.publish.$name       |
+--------------------------------------------+
 


+---------------------------------------------+
|                 web.hook.api.url            |
+---------------------------------------------+

第二个字段对我来说没问题...这是将请求重定向到的 API URL,但我必须在第一个字段“web.hook.rule.message.publish.$name”中插入什么?

L.

4

1 回答 1

0

查看emqx_web_hook.conf以获取详细信息。

像这样:

web.hook.api.url = http://127.0.0.1:8080
## Encode message payload field
##
## Value: base64 | base62
##
## Default: undefined
## web.hook.encode_payload = base64

web.hook.rule.client.connected.1     = {"action": "on_client_connected"}
web.hook.rule.client.disconnected.1  = {"action": "on_client_disconnected"}
web.hook.rule.client.subscribe.1     = {"action": "on_client_subscribe"}
web.hook.rule.client.unsubscribe.1   = {"action": "on_client_unsubscribe"}
web.hook.rule.session.created.1      = {"action": "on_session_created"}
web.hook.rule.session.subscribed.1   = {"action": "on_session_subscribed"}
web.hook.rule.session.unsubscribed.1 = {"action": "on_session_unsubscribed"}
web.hook.rule.session.terminated.1   = {"action": "on_session_terminated"}
web.hook.rule.message.publish.1      = {"action": "on_message_publish"}
web.hook.rule.message.deliver.1    = {"action": "on_message_deliver"}
web.hook.rule.message.acked.1        = {"action": "on_message_acked"}

$name是一个可以是任何字符串的变量,即1在上面的例子中。

于 2019-08-31T08:54:25.960 回答