Webhook connector

The Webhook connector is a sink that sends the rows of a query to an HTTP endpoint with a POST or a PUT request. Use it to start a process or to notify a service when a query finds a row.

Example

The following example sends each row of the query as a JSON message:

CREATE TABLE alert_webhook (
  order_id STRING,
  amount DOUBLE
) WITH (
  'connector' = 'webhook2',
  'url' = 'https://<service-host>/alerts',
  'http-method' = 'POST',
  'http-headers' = 'Content-Type:application/json'
);

INSERT INTO alert_webhook
SELECT order_id, amount
FROM orders
WHERE amount > 1000;

Properties

Table 1. Properties of the Webhook connector
PropertyDescription
connectorwebhook2
urlThe address that receives the requests. It is mandatory.
http-methodPOST or PUT. It is mandatory.
templateA JSON message with placeholders in the form ${column}, which the connector replaces with the values of the row. Without a template, the connector sends the row in the schema of the table.
http-headersAdditional headers of the request, for example for authentication.
max-retriesThe number of retries when a request fails. The default is 4.
initial-expiryThe time before the first retry. The default is 1 second.
back-off-rateThe factor by which the wait grows after each retry. The default is 3.
ignore-failed-recordsWhether the job continues when a request ultimately fails. The default is false, which fails the job.
disable-ssl-verificationWhether the connector skips the check of the certificate of the endpoint. The default is false.

To create a webhook table with the form of the Streaming SQL Console, see Creating a webhook sink. For an example, see Webhook example.