You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New dispatcher that forwards requests to a configured upstream URL
(best-effort) and returns an immediate static response. Useful for
webhook ingestion, async job submission, and audit trails.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Added
11
+
-**plugin**: `fire-and-forget` dispatcher — forwards request to upstream (best-effort) and returns an immediate static response, useful for webhook ingestion, async job submission, and audit trails
Copy file name to clipboardExpand all lines: docs/guide/dispatchers.md
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1050,6 +1050,99 @@ Client: GET /ws/echo?token=abc → Upstream: ws://echo.internal:8080/?token=abc
1050
1050
- **Development mode**: `ws://` URLs are allowed with `--allow-plaintext-upstream`
1051
1051
- **Authentication**: Apply auth middleware (jwt-auth, oidc-auth, etc.) to protect WebSocket endpoints — middleware runs on the initial upgrade request
1052
1052
1053
+
### fire-and-forget
1054
+
1055
+
Forwards the incoming request to a configured upstream URL without waiting for the result, and returns an immediate static response. Useful for webhook ingestion, async job submission, and audit trails.
1056
+
1057
+
The outbound HTTP call is best-effort: if the upstream is unreachable or returns an error, the client still receives the configured response.
1. The request arrives (already processed by the middleware chain)
1089
+
2. The dispatcher forwards method, headers, and body to the configured `url`
1090
+
3. The upstream response is discarded — errors are logged as warnings
1091
+
4. The configured static response is returned to the client
1092
+
1093
+
Because the upstream call happens synchronously in the WASM runtime, the client does wait for the HTTP call to complete (or time out). For truly decoupled async processing, consider using the `kafka` or `nats` dispatchers with a consumer behind them.
1094
+
1095
+
#### Examples
1096
+
1097
+
**Webhook ingestion:**
1098
+
```yaml
1099
+
/webhooks/stripe:
1100
+
post:
1101
+
x-barbacane-dispatch:
1102
+
name: fire-and-forget
1103
+
config:
1104
+
url: "https://processor.internal/stripe-events"
1105
+
timeout_ms: 3000
1106
+
response:
1107
+
status: 202
1108
+
body: '{"received": true}'
1109
+
```
1110
+
1111
+
**Audit logging:**
1112
+
```yaml
1113
+
/audit/events:
1114
+
post:
1115
+
x-barbacane-dispatch:
1116
+
name: fire-and-forget
1117
+
config:
1118
+
url: "http://audit-service:9090/log"
1119
+
response:
1120
+
status: 200
1121
+
body: '{"logged": true}'
1122
+
headers:
1123
+
X-Audit-Status: accepted
1124
+
```
1125
+
1126
+
**Minimal config (defaults to 202, empty body):**
1127
+
```yaml
1128
+
/notify:
1129
+
post:
1130
+
x-barbacane-dispatch:
1131
+
name: fire-and-forget
1132
+
config:
1133
+
url: "https://notification-service.internal/send"
1134
+
```
1135
+
1136
+
#### Error Handling
1137
+
1138
+
The dispatcher never returns an error to the client. Upstream failures are logged but the configured static response is always returned.
"description": "Configuration for the fire-and-forget dispatcher plugin. Forwards the request to an upstream URL and returns an immediate static response.",
6
+
"type": "object",
7
+
"properties": {
8
+
"url": {
9
+
"type": "string",
10
+
"description": "Upstream URL to forward the request to",
11
+
"format": "uri"
12
+
},
13
+
"timeout_ms": {
14
+
"type": "integer",
15
+
"description": "Timeout in milliseconds for the upstream HTTP call",
16
+
"default": 5000,
17
+
"minimum": 1
18
+
},
19
+
"response": {
20
+
"type": "object",
21
+
"description": "Static response returned to the client",
0 commit comments