KIP-646 — Serializer API should support ByteBuffer
Discussion Client
Extends the Serializer interface with a new serialize(topic, headers, data) overload returning ByteBuffer, and updates the Partitioner interface to accept ByteBuffer, enabling zero-copy serialization that avoids allocating intermediate byte arrays. Kafka's Serializer API returned only byte[], requiring a copy from any ByteBuffer-based encoder before the result could be placed in the producer record buffer.
Details
| Author | Chia-Ping Tsai |
| Status | Discussion |
| JIRA | KAFKA-5761 |
| Wiki | View on Apache Wiki |
| Created | 2020-07-22 |
| Last Modified | 2025-05-08 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.