> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotglue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kafka

# Connector Details

| Name        | Value                                                                                    |
| :---------- | :--------------------------------------------------------------------------------------- |
| Platform    | [Apache Kafka](https://kafka.apache.org/)                                                |
| Auth Type   | Broker-dependent (e.g. SASL, TLS)                                                        |
| Direction   | Write                                                                                    |
| Target Repo | [https://github.com/hotgluexyz/target-kafka](https://github.com/hotgluexyz/target-kafka) |

# Target Kafka

`target-kafka` writes Singer streams to Kafka topics using a producer. Each stream name maps to a topic name unless you override it (see `stream_topic_map`). Records are sent as message payloads for that topic.

## Config

Set at least **bootstrap\_servers**. If your brokers require SASL, set **sasl\_username** and **sasl\_password**; the target picks sensible defaults for `security_protocol` and `sasl_mechanism` when those are present. Expand the table below for every option.

```json theme={null}
{
    "bootstrap_servers": "broker1.example.com:9092,broker2.example.com:9092",
    "sasl_username": "...",
    "sasl_password": "...",
    "topic_prefix": "",
    "client_id": "target-kafka"
}
```

## Configuration reference

| Property                | Description                                                                                                                                                          | Default        |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `bootstrap_servers`     | Comma-separated `host:port` list for Kafka bootstrap brokers.                                                                                                        | (required)     |
| `sasl_username`         | SASL username when using SASL (for example PLAIN).                                                                                                                   | —              |
| `sasl_password`         | SASL password paired with `sasl_username`. Treat as a secret.                                                                                                        | —              |
| `security_protocol`     | `PLAINTEXT`, `SSL`, `SASL_PLAINTEXT`, or `SASL_SSL`. If omitted, the target uses `SASL_SSL` when `sasl_username` and `sasl_password` are set, otherwise `PLAINTEXT`. | inferred       |
| `sasl_mechanism`        | SASL mechanism when the protocol is SASL-based (e.g. `PLAIN`, `SCRAM-SHA-256`).                                                                                      | `PLAIN`        |
| `topic_prefix`          | String prepended to each stream name when resolving the Kafka topic.                                                                                                 | `""`           |
| `stream_topic_map`      | Object mapping stream names to topic names; entries override `topic_prefix` + stream name.                                                                           | —              |
| `client_id`             | Client id the producer reports to the cluster.                                                                                                                       | `target-kafka` |
| `flush_timeout`         | Seconds to wait for in-flight messages when flushing on state drain or shutdown.                                                                                     | `30`           |
| `extra_producer_config` | Extra producer settings merged into the client (librdkafka-style keys, e.g. `compression.type`, `linger.ms`).                                                        | —              |
