emqx-docs
emqx-docs copied to clipboard
conflicting documentation for emqx_webhooks and http server
Kindly find below two screenshot. In http server page, it mention use webhook for simple usecases. But in the breaking changes page (4 vs 5), it mentions that in v5, webhook feature is native and will be referred to as http server.
In addition, the opensoure configuration page [1] does not show how to use hocon to configure webhook. I like to understand recommendation. For simple usecase, should we use the webhook plugin [2]? If yes how to configure with hocon?
Indeed, the documentation is not fully correct to say "it is now referred to as HTTP Server bridge". But the rest of the statement stays true: Webhook is now builtin, no plugin is required, and you can use it for simple cases: https://docs.emqx.com/en/emqx/latest/data-integration/webhook.html
Thanks. Could you please also reply to second part of original question.
If yes how to configure with hocon?
I checked hocon page [1] and could not find documentation to configure webhook with hocon. The connector appears to be tied to action.
It is, in fact, created as an HTTP Server bridge (integration). Dashboard uses specific postfix notation to detect webhooks among other HTTP integrations.
In general, the simplest way to get hocon config is to configure something in dashboard, and then check out cluster.hocon in the data/configs directory.
Here is an example for 5.8.6. I created a webhook with name "test".
connectors {
http {
test_WH_D {
enable = true
headers {content-type = "application/json"}
url = "http://localhost:8080"
}
}
}
actions {
http {
test_WH_D {
connector = test_WH_D
enable = true
parameters {
headers {content-type = "application/json"}
method = post
}
}
}
}
rule_engine {
ignore_sys_message = true
rules {
test_WH_D {
actions = [
"http:test_WH_D"
]
enable = true
sql = """~
SELECT
*
FROM
"#"~"""
}
}
}
Thanks. The tip to check generated hocon from dashboard is helpful. I will follow same. But wanted to bring to you attention below points.
Now the documentation is confusing to a new user. Documentation clearly mentions webhooks avoid rule engines, but the generated hocon is using rule engines. To the enduser, now it appears more like, internal implementation of webhook is an always true rule engine. So there is no real performance (or readability from a simpler hocon) benefit we can gain from it. Thanks again.