Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* FIX [docs] Webhook configuration need events instead of event #1763

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 39 additions & 30 deletions docs/en_US/rule/web-hook-0.19.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ NanoMQ provides the following configuration keys for WebHook:

```bash
webhook {
## Multi rules can be added here.
event = [
{
<Rule>
}
]
## Multi rules can be added here.
events = [
{
<Rule>
}
]
}
```

Expand All @@ -45,16 +45,23 @@ webhook {
For example, you want to forward messages matching the topics of `a/b/c` and `foo/#` to the web server, the configuration should be:

```bash
webhook.events = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_message_publish"
topic = "foo/#"
}
]
webhook {
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32

events = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_message_publish"
topic = "foo/#"
}
]
}
```

### WebHook Trigger Events
Expand Down Expand Up @@ -125,20 +132,22 @@ NanoMQ supports defining multiple trigger rules through the configuration file.
The sample configuration is as follows:

```bash
webhook.events = [
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32

{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_client_connack"
}
]
webhook {
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32

events = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_client_connack"
}
]
}
```

`event`: WebHook triggered event, string, supported events include:
Expand Down
70 changes: 35 additions & 35 deletions docs/zh_CN/rule/web-hook-0.19.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Webhook 支持两个配置参数:
```bash
## 格式示例
webhook {
## 此处可以添加多条规则
event = [
{
<Rule>
}
]
## 此处可以添加多条规则
events = [
{
<Rule>
}
]
}
```

Expand All @@ -45,21 +45,21 @@ webhook {

```bash
webhook {
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32
event = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_message_publish"
topic = "foo/#"
}
]
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32

events = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_message_publish"
topic = "foo/#"
}
]
}
```

Expand Down Expand Up @@ -125,20 +125,20 @@ Body: <JSON> # Body 为 JSON 格式字符串

```bash
webhook {
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32
event = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_client_connack"
}
]
url = "http://127.0.0.1:80"
headers.content-type = "application/json"
body.encoding = plain
pool_size = 32

events = [
{
event = "on_message_publish"
topic = "a/b/c"
}
{
event = "on_client_connack"
}
]
}
```

Expand Down
Loading