V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
kan
V2EX  ›  问与答

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

  •  
  •   kan · 2019-08-26 16:29:33 +08:00 · 1952 次点击
    这是一个创建于 1702 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想试下 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);
    }
    

    }

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3228 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 353ms · UTC 14:19 · PVG 22:19 · LAX 07:19 · JFK 10:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.