webhook.http
Trigger an HTTP request for every record.
Description
A processor that sends an HTTP request to the specified URL, retries on error and saves the response body and, optionally, the response status.
Configuration parameters
Name | Type | Default | Description |
---|---|---|---|
backoffRetry.count | float | 0 | Maximum number of retries for an individual record when backing off following an error. |
backoffRetry.factor | float | 2 | The multiplying factor for each increment step. |
backoffRetry.max | duration | 5s | The maximum waiting time before retrying. |
backoffRetry.min | duration | 100ms | The minimum waiting time before retrying. |
request.body | string | . | Specifies which field from the input record should be used as the body in the HTTP request. For more information about the format, see Referencing fields. |
request.contentType | string | application/json | The value of the |
request.method | string | POST | Method is the HTTP request method to be used. |
request.url | string | null | URL used in the HTTP request. |
response.body | string | .Payload.After | Specifies in which field should the response body be saved. For more information about the format, see Referencing fields. |
response.status | string | null | Specifies in which field should the response status be saved. If no value is set, then the response status will NOT be saved. For more information about the format, see Referencing fields. |
Examples
Send a request to an HTTP server
This example shows how to use the HTTP processor to send a record's .Payload.After
field to a dummy HTTP server
that replies back with a greeting.
The record's .Payload.After
is overwritten with the response. Additionally, the example shows how to store the
value of the HTTP response's code in the metadata field http_status
.
Configuration parameters
Name | Value |
---|---|
backoffRetry.count | 0 |
backoffRetry.factor | 2 |
backoffRetry.max | 5s |
backoffRetry.min | 100ms |
request.body | .Payload.After |
request.contentType | application/json |
request.method | POST |
request.url | http://127.0.0.1:54321 |
response.body | .Payload.After |
response.status | .Metadata["http_status"] |
Record difference
Before | After | ||||
1 | { | 1 | { | ||
2 | "position": null, | 2 | "position": null, | ||
3 | "operation": "Operation(0)", | 3 | "operation": "Operation(0)", | ||
4 | - | "metadata": null, | 4 | + | "metadata": { |
5 | + | "http_status": "200" | |||
6 | + | }, | |||
5 | "key": null, | 7 | "key": null, | ||
6 | "payload": { | 8 | "payload": { | ||
7 | "before": null, | 9 | "before": null, | ||
8 | - | "after": "world" | 10 | + | "after": "hello, world" |
9 | } | 11 | } | ||
10 | } | 12 | } |