问个 emqx 的 webhook 插件的配置问题

2019-08-26 16:29:33 +08:00
 kan

我想试下 emqx 的 webhook 插件,但配置完以后无法启动,在网页上的错误弹窗显示的是 Request failed with status code 500,然后在服务器上直接启动( emqx_ctl plugins load emqx_web_hook ) 结果还是报错:

Load plugin emqx_web_hook failed, cannot start plugin emqx_web_hook

所以想问下我配置文件和接口文档应该怎么改,下面是配置文件和接口文档

配置文件( 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.subscribed.1 = {"action": "kan/webHook"} #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"}

接口代码:

package com.kan.api.controller;

import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;

@RestController @RequestMapping("/webHook") public class mqttController {

@RequestMapping
public void receiveWebHookData(@RequestBody  String str){
    System.out.println(str);
}

}

1961 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/595256

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX