# Kafka vs RabbitMQ: source lines of code compared

The Kafka vs RabbitMQ comparison on OctoCounts shows side-by-side source line counts for apache/kafka and rabbitmq/rabbitmq-server, counted with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-17, apache/kafka contains 760,212 total lines (482,069 code) across 4,471 files, while rabbitmq/rabbitmq-server contains 386,944 total lines (266,452 code) across 1,937 files as of 2026-09-08. apache/kafka is about 1.8x the size of rabbitmq/rabbitmq-server by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [apache/kafka](https://octocounts.com/github/apache/kafka) | [rabbitmq/rabbitmq-server](https://octocounts.com/github/rabbitmq/rabbitmq-server) |
| --- | ---: | ---: |
| Files | 4,471 | 1,937 |
| Total lines | 760,212 | 386,944 |
| Code lines | 482,069 | 266,452 |
| Comment lines | 193,641 | 64,889 |
| Blank lines | 84,502 | 55,603 |
| Languages counted | 12 | 12 |

Top languages in apache/kafka: Java (90.4% of code), Scala (4.3% of code), JSON (3.5% of code). Top languages in rabbitmq/rabbitmq-server: Erlang (65.8% of code), JSON (10.6% of code), JavaScript (9.1% of code). JSON appears in both top language lists; Java, Scala, Python, XML appear only in apache/kafka's top languages; Erlang, JavaScript, Elixir, Makefile appear only in rabbitmq/rabbitmq-server's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. apache/kafka was counted at ref da078363444635eebe52cefc5a2c1baf11b8fbce (commit da0783634446) on 2026-09-17; rabbitmq/rabbitmq-server was counted at ref main (commit 76ff984fc61a) on 2026-09-08. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

apache/kafka counts the Kafka repository: the broker, the Java client, Connect, Streams, and their tests, with the server written in a mix of Scala and Java. rabbitmq/rabbitmq-server counts the RabbitMQ server repository: the broker written primarily in Erlang, plus its core plugins and test suites. Both are message-broker source trees, but implemented in different languages, as the per-language tables above show.

The per-language tables make the implementation split legible at a glance: Kafka's counted code is predominantly Java and Scala, while RabbitMQ's is predominantly Erlang — each broker built on its language's concurrency model.

Each repository counts the broker core, but the scoping differs slightly: Kafka's client libraries and Streams live in the same tree, while part of RabbitMQ's plugin ecosystem lives in separate repositories, so the totals are not framed identically on both sides.

_Broker repository size does not measure throughput, latency, or operational footprint — those depend on configuration, workload, and cluster topology. Use these counts to compare the size and shape of the two source trees, not to choose a message broker._

Sources: [apache/kafka repository (broker, clients, Connect, Streams)](https://github.com/apache/kafka) · [rabbitmq/rabbitmq-server repository (Erlang broker)](https://github.com/rabbitmq/rabbitmq-server). Statements verified 2026-09-16.

Evidence and next steps:

- [apache/kafka SLOC report](https://octocounts.com/github/apache/kafka)
- [rabbitmq/rabbitmq-server SLOC report](https://octocounts.com/github/rabbitmq/rabbitmq-server)
- [Compare apache/kafka and rabbitmq/rabbitmq-server interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fapache%2Fkafka&right=https%3A%2F%2Fgithub.com%2Frabbitmq%2Frabbitmq-server)

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

## Compare FAQ

### Which has more lines of code, apache/kafka or rabbitmq/rabbitmq-server?

apache/kafka has more code: 482,069 code lines versus 266,452 for rabbitmq/rabbitmq-server, about 1.8x as much, based on cached OctoCounts reports as of 2026-09-17.

### Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for apache/kafka, rabbitmq/rabbitmq-server, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. apache/kafka was counted at ref da078363444635eebe52cefc5a2c1baf11b8fbce (commit da0783634446) on 2026-09-17; rabbitmq/rabbitmq-server was counted at ref main (commit 76ff984fc61a) on 2026-09-08. See the counting methodology for ignored directories and analysis options.

### Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
