conduktor.io ↗

Kafka Envelope Request Wire Format v0 — Binary Protocol Layout

What is Envelope?

Brokers use this to forward client requests to the KRaft controller while preserving the original client's identity for authorization. When a broker proxies a CreateTopics request to the controller, the ACL check uses the actual client's principal, not the broker's.

Wire Diagram

Request Header · flexible
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string (compact)
tagged var
EnvelopeRequest v0
RequestData bytes (compact)
RequestPrincipal? bytes (compact)
ClientHostAddress bytes (compact)
tagged var

Schema & Example

Schema
{
  "RequestData": bytes,
  "RequestPrincipal": bytes?,
  "ClientHostAddress": bytes
}
Example
{
  "RequestData": "<binary>",
  "RequestPrincipal": "<binary>",
  "ClientHostAddress": "<binary>"
}