Skip to main content

Generic extract/load node: reads from a configurable input and writes to a configurable output

Project description

tkati-node-el — generic extract/load node

Reads batches from a configurable input and writes them to a configurable output. Offsets are committed only after a successful write (at-least-once delivery).

Input and output kinds are selected via the type field in each section — pick from whatever tkati-core supports. Every backend's settings split a connection tier (server-specific: how to reach the broker/database) from the resource tier (topic for Kafka, table for ClickHouse) and, where relevant, a tier local to this reader/writer instance (Kafka's consumer settings).

  • Input: "kafka" (JSON or Arrow-batch messages from a Kafka/Redpanda topic)
  • Output: "kafka" or "clickhouse" (native Arrow insert)
  • DLQ: same OutputSettings shape as output — a DLQ can be Kafka or ClickHouse too

Configuration

Settings are loaded from a TOML file. Set the SETTINGS_FILE environment variable to point to it (defaults to settings.toml).

[input]
type = "kafka"

[input.connection]
broker = "redpanda:29092"

[input.topic]
name   = "traffic_event"

[input.topic.schema]
uid        = "string"
time       = "timestamp[ms]"
traffic_in = "uint32"
# … other columns

[input.consumer]
group_id          = "node-el-group"
batch_size        = 1000
batch_timeout_sec = 10
auto_offset_reset = "latest"

[output]
type             = "clickhouse"
dlq_split_factor = 10

[output.connection]
host     = "clickhouse"
port     = 9000
user     = "default"
password = ""
secure   = false

[output.table]
database = "default"
name     = "traffic_event"

[dlq]
type = "kafka"

[dlq.connection]
broker = "redpanda:29092"

[dlq.topic]
name = "node-el-dlq"

A Kafka output instead looks like:

[output]
type = "kafka"

[output.connection]
broker = "redpanda:29092"

[output.topic]
name   = "some-other-topic"
format = "json"        # or "arrow-batch"
key_column = "uid"     # optional

A ClickHouse DLQ instead looks like:

[dlq]
type = "clickhouse"

[dlq.connection]
host     = "clickhouse"
port     = 9000
user     = "default"
password = ""
secure   = false

[dlq.table]
database = "default"
name     = "traffic_event_dlq"

DLQ semantics

DLQ fallback triggering is currently only implemented for the clickhouse output kind — KafkaProducer has no retry/split logic of its own. The DLQ sink itself (where isolated bad rows end up) can be Kafka or ClickHouse, independent of the primary output. When a batch insert fails after all retries, the app switches to a recursive fallback to isolate the problematic rows:

  1. The failing batch is split into dlq_split_factor equal sub-batches and each is retried independently.
  2. If a sub-batch also fails it is split again — this repeats until individual rows are reached.
  3. A single row that ClickHouse still rejects is written to the DLQ sink, preserving the full schema (Arrow IPC arrow-batch format for a Kafka DLQ).
  4. After all rows are handled (inserted or DLQ'd), the input offset is committed and the app resumes normal large-batch processing.

dlq_split_factor is a setting on the clickhouse [output] block (see above), not on [dlq] — it describes how the primary output retries, independent of where the DLQ sink sends isolated rows. With dlq_split_factor=10 and a 1 000-row batch this takes at most 3 recursive levels (1000 → 100 → 10 → 1).

Delivery guarantee: at-least-once. If the process crashes mid-recursion the uncommitted batch is re-read on restart and re-processed from the beginning, which may produce duplicate rows in the output and duplicate messages in the DLQ.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkati_node_el-0.3.0a3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkati_node_el-0.3.0a3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file tkati_node_el-0.3.0a3.tar.gz.

File metadata

  • Download URL: tkati_node_el-0.3.0a3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tkati_node_el-0.3.0a3.tar.gz
Algorithm Hash digest
SHA256 5d0e4984124bd3b30510c78d62ada17cb288a0f03e8791a7f182960d91fc2f96
MD5 05ac95c4bd72e16a996083eb6c895739
BLAKE2b-256 6202670be11dee726369225c8f5c8a9c9c7f02f0d69b31e4fb607c98afbfb702

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkati_node_el-0.3.0a3.tar.gz:

Publisher: publish-tkati-node-el.yml on epoch8/tkati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tkati_node_el-0.3.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for tkati_node_el-0.3.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 3970f64f725c7fa62e5b6b2cf077099f989d124bfd912abd8faf7673c62dce72
MD5 7fb3a5a57fed76b3fac790c5fe41092e
BLAKE2b-256 fa3c03fa9140a6c896119f10edec6aeae689d81f57b59df5c9e9228b42eab6c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tkati_node_el-0.3.0a3-py3-none-any.whl:

Publisher: publish-tkati-node-el.yml on epoch8/tkati

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page