Skip to content
uencoder

Protobuf Stream

Protobuf streaming concatenates multiple length-prefixed Protobuf messages, supporting stream transport and per-message parsing.

Purpose

To transport multiple Protobuf messages over TCP/gRPC streams, with a varint length prefix delimiting each message.

Mechanism

Each message is encoded as a varint length prefix plus the Protobuf bytes. The receiver reads the varint length, reads that many bytes, parses one message, and repeats. The gRPC frame format works this way.

Use cases

  • gRPC streaming RPC
  • Kafka Protobuf messages
  • Log stream transport

Related tools

References