NotifierHTTP¶
sink extra: notifier-http
Transmit message to a HTTP endpoint.
- Node type:
NotifierHTTP- Input:
ObjectPayload- Output:
–
- Extra:
notifier-http
$ pip install "juturna-nodes[notifier-http]"
How it works¶
Messages are serialised and queued, and a dedicated worker sends them one at a
time, so a slow endpoint does not block the pipeline. The pipeline id is added
to the message as meta['pipe_id'].
The body is the message serialised once with Message.to_json(), whatever the
content_type: arrays become lists and bytes become base64 text. Only the
Content-Type header changes. Any other content_type makes the node fail at
build time.
Failed requests (connection errors and 4xx and 5xx responses) are logged as warnings and the message is dropped: there are no retries. When the node stops, the worker is given a few seconds to drain the queue.
The endpoint can be changed at runtime through set_on_config.
Arguments¶
Argument |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Destination URL, including the port |
|
|
|
Request timeout, in seconds |
|
|
|
|
License¶
Code: this node is part of juturna-nodes, MIT (its
LICENSEfile).requests: Apache-2.0 (the license of requests on PyPI).
Configuration¶
Default node arguments, as defined in the node config.toml file. Any of
them can be overridden in the node configuration of a pipeline.
[arguments]
endpoint = "http://localhost:8080"
timeout = 20
content_type = "application/json"
[meta]
Pipeline usage¶
{
"name": "notifier_http",
"type": "NotifierHTTP",
"configuration": {}
}
Reference¶
- class NotifierHTTP(endpoint: str, timeout: int, content_type: str, **kwargs)
Send data to a HTTP endpoint