KIP-1265 — Mechanism for automatic detection of internal API usage
Accepted Kafka 4.4 Admin
Introduces a @PublicApi annotation and build-time enforcement mechanism that explicitly marks classes as public API and triggers compile or test failures when internal classes are inadvertently imported by or exposed through public APIs. Kafka's current convention (Javadoc presence = public) is implicit and unenforced, frequently resulting in internal classes leaking into public interfaces and being adopted by plugin developers without stability guarantees.
Details
| Author | Ashwin Pankaj |
| Status | Accepted |
| Kafka Version | 4.4 |
| JIRA | KAFKA-20032 |
| Wiki | View on Apache Wiki |
| Created | 2026-01-05 |
| Last Modified | 2026-06-30 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.