REST/HTTP

DataCater can stream insertions and updates processed by a data pipeline to a REST/HTTP endpoint. Deletions are ignored.


Configuration

This sink connector supports the following configuration options:

URI

The URI of the REST endpoint, including the HTTP scheme, i.e., http:// or https://.

HTTP method

POST, PUT, PATCH or DELETE.

HTTP request header

The header for the HTTP request (default: Content-Type:application/json). Multiple header entries can be separated by a pipe (|).

Maximum number of retries

When the REST endpoint is unavailable, the sink connector automatically retries sending requests to the REST endpoint up to a given number of attempts (default: 10).

Backoff interval for retries

The sink connectors waits a given amount of time between making retry attempts (default: 10,000 ms).

Token exchange URI

If the REST endpoint is using time-based access tokens for authentication, you can here specify an URI, which is called for generating a new token when the REST endpoint returns HTTP status code 401.

Token exchange HTTP method

HTTP method to use for requesting a new token.

Token exchange HTTP request headers

HTTP request headers to use for requesting a new token.

Token exchange HTTP request body

HTTP request body to use for requesting a new token. Only available if POST is used as Token exchange HTTP method.

JSON Pointer to token

If the token endpoint does not directly return the token string but a JSON object, you may provide a JSON pointer to locate the token string in the JSON structure.


Data Types

DataCater does not require schema mapping for this sink connector but passes the pipeline records as JSON objects to the REST endpoint.

Note that string values, which hold valid JSON objects or arrays, are automatically transformed into a JSON representation. This way, the sink connector allows to ingest arbitrarily complex JSON structures into REST endpoints.


Request Templating

In the configuration fields HTTP URI and HTTP request header, you can make use of the Freemarker template engine to build dynamic requests, which is especially useful when using temporary access tokens.

We provide the following variables for the templating:

  • ${token}: The access token retrieved from the specified token endpoint.