Skip to content

Kafka

Apache Kafka is a distributed open-source message broker. The Tenzir integration can publish (send messages to a topic) or subscribe (receive) messages from a topic.

Apache KafkaBrokerTopicPartition APartition B...Topic

Internally, we use Confluent’s official librdkafka library, which gives us full control in passing options.

Examples

Send events to a Kafka topic

from {
x: 42,
y: "foo",
}
to "kafka://topic" {
write_ndjson
}

Subscribe to a topic

The offset option controls where to start reading:

from "kafka://topic", offset="beginning" {
read_ndjson
}

Other values are "end" to read at the last offset, "stored" to read at the stored offset, a positive integer representing an absolute offset, or a negative integer representing a relative offset counting from the end.