apache/kafka
By the numbers
A quantitative snapshot of the Apache Kafka codebase. Counts come from the working tree at the wiki's commitHash (see .wiki-meta.json) and from git log against the default branch (trunk). Languages and modules listed here mirror what the build system tracks.
Data collected on 2026-04-30.
Size
xychart-beta horizontal
title "Lines of code by language"
x-axis [Java, Scala, Python, Other]
y-axis "kLOC" 0 --> 1500
bar [1444, 150, 50, 30]| Language | Files (approx) | Lines (approx) |
|---|---|---|
| Java | 5,878 | 1,443,763 |
| Scala | 296 | 149,699 |
| Python | 177 | system tests + helpers in tests/, committer-tools/, vagrant/ |
| Shell | ~90 | launcher scripts under bin/, tests/, docker/ |
| JSON schema | ~250 RPC messages | under clients/src/main/resources/common/message/ and per-coordinator schema dirs |
Java is the dominant language; Scala is concentrated in core/ (the broker request-handling layer) and in streams/streams-scala/.
Modules
The Gradle build defines roughly 50 modules in settings.gradle. The most active are:
| Module | Purpose |
|---|---|
clients |
Producer, Consumer, Admin, shared common/* types |
core |
Scala broker — KafkaApis, ReplicaManager, request pipeline |
streams |
Kafka Streams library |
connect/runtime |
Connect framework |
raft |
KRaft consensus implementation |
metadata |
Metadata image, controller, MetadataLoader |
storage, storage-api |
Log storage, segments, indexes, tiered storage |
group-coordinator |
Consumer group coordinator (classic + KIP-848) |
share-coordinator |
Share group coordinator (KIP-932) |
transaction-coordinator |
Transaction coordinator |
coordinator-common |
Shared replicated-state-machine runtime for all coordinators |
tools |
Java implementations of kafka-*.sh CLIs |
server, server-common |
Shared broker infrastructure used outside core |
jmh-benchmarks |
JMH microbenchmarks |
trogdor |
Distributed test/fault-injection harness |
streams:upgrade-system-tests-* |
One module per supported Streams upgrade path (0.11 through 4.x) |
Activity
| Window | Commits |
|---|---|
| Total (since 2011-08) | 17,420 |
| Last 90 days | 518 |
| 2024 (calendar year) | 2,448 |
| 2025 (calendar year) | 2,185 |
xychart-beta horizontal
title "Commits per year (default branch)"
x-axis [2011, 2013, 2015, 2017, 2019, 2021, 2023, 2025]
y-axis "commits" 0 --> 2500
bar [116, 350, 762, 1507, 1219, 1280, 1474, 2185]The trend roughly tracks Kafka's adoption: a bump in 2017 (Streams + Connect maturing), elevated activity through the KRaft transition (2020-2024), and very high activity in 2024-2025 driven by the ZooKeeper removal, KIP-848 (new consumer protocol), KIP-932 (share groups), and KIP-405 (tiered storage) work.
Churn hotspots (last 90 days)
The files touched most often in the last 90 days are concentrated in the new consumer-group protocol and the broker request handling layer:
| File | Touches |
|---|---|
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java |
26 |
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java |
22 |
core/src/test/scala/unit/kafka/server/KafkaApisTest.scala |
22 |
gradle/dependencies.gradle |
18 |
build.gradle |
17 |
core/src/main/scala/kafka/server/KafkaApis.scala |
15 |
streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java |
13 |
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java |
13 |
That signal lines up with what's currently shipping: the consumer-group state machine, the Scala broker's RPC dispatcher, and dependency upgrades.
Contributors
The wider Kafka community is large; the snapshot below is just the most active committers (by number of commits to the default branch since 2024-01-01) — useful for triage rather than for ownership. There is no CODEOWNERS file, so subsystem ownership is best discovered via git log <path> (see maintainers.md — not generated; ownership is tracked via the Apache committer roster instead).
| Contributor | Commits since 2024-01-01 |
|---|---|
| PoAn Yang | 239 |
| Ken Huang | 238 |
| Matthias J. Sax | 218 |
| David Jacot | 201 |
| TengYao Chi | 175 |
| Andrew Schofield | 165 |
| Mickael Maison | 160 |
| David Arthur | 132 |
| Lucas Brutschy | 130 |
| Apoorv Mittal | 124 |
Bot-attributed commits
A git log --grep for the standard bot signatures (factory-droid[bot], dependabot[bot], github-actions[bot], copilot[bot]) finds 1 matching commit out of 17,420 total. Apache projects historically merge bot work under human committer identities, so this is a hard lower bound on AI- or bot-assisted activity rather than a measurement of it.
Complexity hotspots
A few files are notably large and worth knowing about — they tend to be the ones a contributor encounters first when changing broker behavior, the consumer, the producer, or Streams.
| File | Size (lines) |
|---|---|
core/src/main/scala/kafka/server/KafkaApis.scala |
~5,200 |
core/src/main/scala/kafka/server/ReplicaManager.scala |
~3,600 |
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java |
~3,000 |
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java |
~2,700 |
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java |
~2,500 |
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java |
~3,100 |
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java |
~3,400 |
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java |
~4,400 |
These files are also the most expensive to review and the most touched. Several of them are split into smaller helpers in their internals/ package — for example, the producer's Sender, RecordAccumulator, and TransactionManager carry most of the actual logic that KafkaProducer.java orchestrates.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.