Skip to main content

Singer target for Kafka, built with the Meltano Singer SDK.

Project description

target-kafka

target-kafka is a Singer target for Apache Kafka, built with the Meltano Singer SDK. It writes tap output to Kafka topics (one topic per stream) with configurable batching, compression, and message keys. Delivery is at-least-once: on failure, records may be retried and duplicates are possible.

Installation

Install from PyPI:

uv tool install target-kafka

Install from GitHub (replace your-org with your GitHub org or username):

uv tool install git+https://github.com/your-org/target-kafka.git@main

Publishing: To publish to PyPI and add this loader to Meltano Hub, see docs/PUBLISHING.md. For version bumps and release steps, see docs/RELEASING.md.

Configuration

Accepted config options

Setting Required Default Description
bootstrap_servers Yes Kafka bootstrap servers (comma-separated, e.g. localhost:9092,localhost:9093)
topic_prefix No "" Prefix to add to all topic names
key_properties No [] Record properties to use as Kafka message key (empty = round-robin partition)
batch_size No 100 Number of records to batch before sending to Kafka
compression_type No snappy Kafka message compression: none, gzip, snappy, lz4, zstd
include_sdc_properties No true Include Meltano metadata (_sdc_extracted_at, _sdc_received_at, etc.)
common_topic No When set, all streams write to this topic; each record gets a stream field with the source stream name and validation is disabled. When unset, each stream uses its name as the topic (with optional topic_prefix).

Common topic (all streams to one topic): Set common_topic (e.g. raw-slack-events) to send every stream to that single topic. The target adds a stream property to each record with the source stream name so consumers can filter or route. Schema validation is disabled in this mode because records from different streams may have different shapes. If the tap already sends a stream property, it is overwritten with the target’s stream name.

A full list of supported settings and capabilities is available by running:

target-kafka --about

Configure using environment variables

With --config=ENV, the target reads configuration from environment variables (and from a .env file in the working directory if present). Use names like TARGET_KAFKA_BOOTSTRAP_SERVERS, TARGET_KAFKA_TOPIC_PREFIX, etc. See .env.example for a template.

Usage

Run with Meltano

You can run target-kafka in a pipeline using Meltano:

meltano run tap-smoke-test target-kafka

Run the target directly

target-kafka --version
target-kafka --help

# Example with config file
tap-smoke-test | target-kafka --config config.json

# Example with env config
tap-smoke-test | target-kafka --config ENV

This target works in any Singer environment and does not require Meltano.

Developer resources

Prerequisites

  • Python 3.10+
  • uv

Setup and tests

uv sync
uv run pytest
uv run target-kafka --help

Testing with Meltano

uv tool install meltano
meltano invoke target-kafka --version
meltano run tap-smoke-test target-kafka

SDK dev guide

See the Singer SDK dev guide for developing taps and targets.

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

target_kafka-0.1.3.tar.gz (179.7 kB view details)

Uploaded Source

Built Distribution

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

target_kafka-0.1.3-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file target_kafka-0.1.3.tar.gz.

File metadata

  • Download URL: target_kafka-0.1.3.tar.gz
  • Upload date:
  • Size: 179.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for target_kafka-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9431ee30b91a00b57be2f10787618ac1dc7bdaa0d47bcc57be2117f793c16f6d
MD5 f41b3a1e106e13df241f758db9379b69
BLAKE2b-256 5dbdc232e84d029f75c24453782999ea4e7308b7c82b0b3ddf64236a0c3a2eed

See more details on using hashes here.

Provenance

The following attestation bundles were made for target_kafka-0.1.3.tar.gz:

Publisher: build.yml on rishipradeep-think41/target-kafka

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

File details

Details for the file target_kafka-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: target_kafka-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for target_kafka-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 760b186af874760a65acd50e75c2a614e5c46265d2f0cd96de72e5f32a55d441
MD5 1ea00da37edf47b098475b7684e45077
BLAKE2b-256 7f8c848a5c7b149152d96e73597d9dc1fae3da50aa159d60dee740dff1be497b

See more details on using hashes here.

Provenance

The following attestation bundles were made for target_kafka-0.1.3-py3-none-any.whl:

Publisher: build.yml on rishipradeep-think41/target-kafka

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