

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1<!--2 Licensed to the Apache Software Foundation (ASF) under one or more3 contributor license agreements. See the NOTICE file distributed with4 this work for additional information regarding copyright ownership.5 The ASF licenses this file to You under the Apache License, Version 2.06 (the "License"); you may not use this file except in compliance with7 the License. You may obtain a copy of the License at89 http://www.apache.org/licenses/LICENSE-2.01011 Unless required by applicable law or agreed to in writing, software12 distributed under the License is distributed on an "AS IS" BASIS,13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 See the License for the specific language governing permissions and15 limitations under the License.16-->1718# Agent Guide for Apache Kafka1920This file is read by automated agents (security scanners, code analyzers,21AI assistants) operating on this repository.2223## Project overview2425Apache Kafka is a distributed event streaming platform. This repo is a **Gradle**26build in **Java** and **Scala 2.13**.2728- **Supported JDK**: 11+ for `clients`, `generator`, and `streams`; 17+ for other modules.29- **Build/test JDK**: Java 17 and 25.30- **Build tool**: Gradle, wrapper `./gradlew` is recommended.3132## Repository layout (high level)3334| Path | Purpose |35|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|36| `clients/` | Producer, consumer, admin client APIs and protocol messages |37| `core/` | Broker runtime, log, replication, request handling (gradually being removed along with Scala code) |38| `server/`, `server-common/` | Broker/server components and shared server code |39| `metadata/`, `raft/` | KRaft metadata layer and Raft implementation |40| `storage/`, `storage/api/` | Log segments, checkpoints, tiered storage APIs |41| `group-coordinator/`, `share-coordinator/`, `transaction-coordinator/`, `coordinator-common/` | Coordinators |42| `connect/` | Kafka Connect (api, runtime, plugins, transforms) |43| `streams/` | Kafka Streams (+ Scala, examples, upgrade system tests) |44| `generator/` | RPC/message code generation |45| `tools/`, `shell/` | CLI tools and kafka metadata shell |46| `examples/` | Kafka producer and consumer examples |47| `jmh-benchmarks/` | Kafka benchmarks tests |48| `trogdor/` | test framework |49| `tests/` | System test harness (see `tests/README.md`) |50| `config/` | Sample broker/controller configuration |51| `checkstyle/` | Checkstyle rules and import-control XML |52| `docs/` | Documentation sources |53| `docker/` | Docker images, build/test scripts, and examples for JVM and native Kafka |545556## Build commands5758```bash59# Compile jars60./gradlew jar6162# Release tarball (output under core/build/distributions/)63./gradlew clean releaseTarGz6465# Publish to local Maven (skip signing for local dev)66./gradlew -PskipSigning=true publishToMavenLocal6768# Regenerate RPC/message classes after branch switches69./gradlew processMessages processTestMessages7071# List tasks72./gradlew tasks73```7475Module-scoped build:7677```bash78./gradlew core:jar79./gradlew clients:jar80./gradlew :streams:testAll81```8283## Test commands8485```bash86# All unit + integration tests87./gradlew test8889# Split suites90./gradlew unitTest91./gradlew integrationTest9293# Include flaky tests (marked @Flaky)94./gradlew test -Pkafka.test.run.flaky=true9596# Re-run without considering up-to-date97./gradlew test --rerun-tasks9899# Single test class100./gradlew clients:test --tests RequestResponseTest101102# Single test method103./gradlew clients:clients-integration-tests:test --tests org.apache.kafka.clients.producer.ProducerFailureHandlingTest.testCannotSendToInternalTopic104105# Coverage (whole project or one module)106./gradlew reportCoverage -PenableTestCoverage=true -Dorg.gradle.parallel=false107./gradlew clients:reportCoverage -PenableTestCoverage=true -Dorg.gradle.parallel=false108```109110**Test retries** (optional): `-PmaxTestRetries=1 -PmaxTestRetryFailures=3`111112**Logging**: adjust `log4j2.yaml` under `<module>/src/test/resources/` for verbose test logs.113114**System tests**: see [tests/README.md](tests/README.md).115116## Code quality117118Run before submitting Java changes:119120```bash121./gradlew spotlessApply # fix import order / formatting122./gradlew checkstyleMain checkstyleTest spotlessCheck123./gradlew spotbugsMain spotbugsTest -x test # optional static analysis124```125126Checkstyle reports: `<module>/build/reports/checkstyle/`.127128## Coding conventions129130- **Commits / PR titles**: Start with `KAFKA-XXXXX`, `MINOR`, or `HOTFIX`. Use `KAFKA-XXXXX` only when there is a valid Jira ticket for the change.131- **AI-generated contributions**: Follow the [AI-Generated Contributions](CONTRIBUTING.md#ai-generated-contributions) section in `CONTRIBUTING.md` — add a `Co-Authored-By` or `Generated-by` commit trailer for AI-assisted changes.132- **Public API / KIP**: Changes to public interfaces, wire protocol, configurations, or metrics generally require a [KIP](https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Improvement+Proposals). See the `javadoc` `include` list in [build.gradle](build.gradle) for packages treated as public API.133- **License header**: New source files need the standard ASF license header (see existing files in the same module).134- **Checkstyle**: Enforced on main and test sources; rules in `checkstyle/`. Import order is checked via Spotless.135- **Generated code**: Do not hand-edit generated RPC/message sources. Regenerate with `processMessages` / `processTestMessages`. See [clients/src/main/resources/common/message/README.md](clients/src/main/resources/common/message/README.md).136- **Scope**: Prefer targeted unit tests in the module you change; integration/system tests for cross-component behavior.137- **Compatibility**: clients, generator, and streams modules support Java 11+; all other modules require Java 17+. Avoid APIs that break those release levels.138139## Security140141See [SECURITY.md](./SECURITY.md) for how to report a vulnerability and for links142to the Apache Kafka security model under [docs/security/](./docs/security/).143144Agents that scan this repository should consult `SECURITY.md` and the linked145security model before reporting issues. In particular, the core model defines146what is in and out of scope, how reports are classified, and a list of known147non-findings; each component page adds its own known non-findings.148149## Reference docs150151| Topic | Location |152|--------------------------------|----------|153| Build, test, broker quickstart | [README.md](README.md) |154| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md), https://kafka.apache.org/contributing.html |155| Message protocol / codegen | [clients/src/main/resources/common/message/README.md](clients/src/main/resources/common/message/README.md) |156| System tests | [tests/README.md](tests/README.md) |157| JMH benchmarks | [jmh-benchmarks/README.md](jmh-benchmarks/README.md) |158| Client examples | [examples/README.md](examples/README.md) |159| Security | [SECURITY.md](SECURITY.md) |160
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| vllm-project/vllmAGENTS.md · 89k | AGENTS.md | setuptestlint-formatstyle+5 | 100/100 | 14 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/apache-kafka-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.