Skip to main content

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

NameTypeDefaultDescription
backoffRetry.countfloat0

Maximum number of retries for an individual record when backing off following an error.

backoffRetry.factorfloat2

The multiplying factor for each increment step.

backoffRetry.maxduration5s

The maximum waiting time before retrying.

backoffRetry.minduration100ms

The minimum waiting time before retrying.

request.bodystring.

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.contentTypestringapplication/json

The value of the Content-Type header.

request.methodstringPOST

Method is the HTTP request method to be used.

request.urlstring
null

URL used in the HTTP request.

response.bodystring.Payload.After

Specifies in which field should the response body be saved.

For more information about the format, see Referencing fields.

response.statusstring
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

NameValue
backoffRetry.count0
backoffRetry.factor2
backoffRetry.max5s
backoffRetry.min100ms
request.body.Payload.After
request.contentTypeapplication/json
request.methodPOST
request.urlhttp://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
}