Kafka Client Libraries & SDKs

Pick your language. Each guide compares its Kafka clients side by side and recommends one for each use case, checked against specific releases.

Kafka clients by language

Stream processing

For windows, joins, and aggregates with recoverable state, compare stream processing libraries instead.

How to choose a Kafka client library

Clients differ in how they are built, which Kafka features they support, and how actively they are maintained.

librdkafka wrapper or independent

librdkafka is Confluent's C client. Wrappers add it as a native dependency and expose different parts of it. Independent clients implement the protocol themselves; coverage and build requirements vary.

Schema Registry support

Confluent publishes Avro, Protobuf, and JSON Schema serializers for Java, Python, Go, .NET, JavaScript, and C++ (libschemaregistry). Support in other clients varies.

Protocol features

Transactions, cooperative rebalancing, and the KIP-848 consumer group protocol, generally available since Kafka 4.0, are where clients differ most. Check them against the release you pick.

Authentication

SASL PLAIN and SCRAM work almost everywhere. Support for Kerberos (GSSAPI), OAUTHBEARER, and AWS MSK IAM varies, and prebuilt librdkafka packages often leave out GSSAPI.

Maintenance

Look at recent releases and how many people merge changes. Several clients rely on one maintainer; KafkaJS has not shipped since February 2023, and modern-cpp-kafka was archived in July 2026.

Default partitioners

The Java client hashes keys with Murmur2, librdkafka with CRC32, and Sarama with FNV-1a, so the same key can land on different partitions. To spot a mismatch, search for the key in Kafma's Console.

Which clients are built on librdkafka

Clients built on librdkafka need its native library. Their defaults and features depend on the librdkafka version, the wrapper, and how it is packaged.

Language Built on librdkafka Independent implementation
Java — Apache Kafka client (official)
Pythonconfluent-kafkakafka-python, aiokafka
Goconfluent-kafka-gofranz-go, kafka-go, Sarama
JavaScript & Node.jsconfluent-kafka-javascript, node-rdkafkaKafkaJS, Platformatic Kafka
C# & .NETConfluent.KafkaDekaf
Rustrdkafkarskafka, krafka
C & C++librdkafka, cppkafka, modern-cpp-kafka —
PHPphp-rdkafkalonglang/phpkafka

Kafka Clients FAQ

Which Kafka client is official?
The Apache Kafka project maintains one client: the Java client, published as org.apache.kafka:kafka-clients. Confluent maintains librdkafka and its clients for Python, Go, .NET, and JavaScript. Other libraries are maintained by their own projects.
Which Kafka client should I use with Kotlin or Scala?
The Apache Kafka Java client. Kotlin, Scala, Groovy, and Clojure run on the JVM and can call it directly; Scala libraries such as ZIO Kafka and FS2 Kafka wrap it, and Kafka Streams ships a Scala API. See the Java client guide.
What is librdkafka?
A Kafka client library written in C and maintained by Confluent. It implements producers, consumers, transactions, and Admin operations, and it is the engine inside confluent-kafka for Python, confluent-kafka-go, Confluent.Kafka, confluent-kafka-javascript, node-rdkafka, the Rust rdkafka crate, and php-rdkafka. C and C++ applications can use it directly.
Can a producer and a consumer use different client libraries?
Yes. Every client uses the same wire protocol, so a Go producer and a Python consumer can share a topic. They must agree on the serialization format, including the Schema Registry wire format if you use one. If several producers write the same keys and each key must stay on one partition, they must serialize keys to the same bytes and use partitioners that map them the same way.
Does my client version have to match the broker version?
No. Most clients negotiate protocol versions with the broker, so a newer client works with an older broker and the other way round, although features such as transactions or KIP-848 need support on both sides. Kafka 4.0 removed the oldest protocol versions: 4.0 brokers no longer accept Java clients older than 2.1, and 4.0 Java clients need brokers on 2.1 or newer. Check older non-Java clients before upgrading brokers to 4.0.
Do I need Kafka Streams?
Mainly for stateful processing: windows, joins, or aggregates that must survive a restart. It handles stateless steps too, but a plain client is enough for producing, consuming, and simple transformations. Kafka Streams runs on the JVM; for other languages, see the stream processing guides above.

Ready to try the Kafka IDE?

Whichever client library you choose, Kafma helps you inspect and debug the messages it produces and consumes.

Available for macOS, Windows, Linux