Kafka
The Kafka output component writes messages to a Kafka topic.
Configuration
brokers
A list of broker addresses to connect to.
type: array of string
topic
The topic to write messages to. Supports both static values and SQL expressions.
type: object
One of:
type: "value"withvalue: string- Static topic nametype: "expr"withexpr: string- SQL expression to evaluate topic name
key
The key to set for each message (optional). Supports both static values and SQL expressions.
type: object
One of:
type: "value"withvalue: string- Static key valuetype: "expr"withexpr: string- SQL expression to evaluate key
client_id
The client ID to use when connecting to Kafka.
type: string
compression
The compression type to use for messages.
type: string
One of:
none- No compressiongzip- Gzip compressionsnappy- Snappy compressionlz4- LZ4 compression
acks
The number of acknowledgments the producer requires the leader to have received before considering a request complete.
type: string
One of:
0- No acknowledgment1- Leader acknowledgment onlyall- All replicas acknowledgment
value_field
The field to use as the message value. If not specified, uses the default binary value field.
type: string
Examples
output:
type: "kafka"
brokers:
- "localhost:9092"
topic:
type: "expr"
expr: "concat('1','x')"
key:
type: "value"
value: "my-key"
client_id: "my-client"
compression: "gzip"
acks: "all"
value_field: "message"
output:
type: "kafka"
brokers:
- "localhost:9092"
topic:
type: "value"
value: "my-topic"
compression: "snappy"
acks: "1"