Skip to main content
Version: 0.7.x
protobufCODEC

Protobuf

The Protobuf codec converts between binary Protobuf messages and columnar Arrow RecordBatches using a descriptor compiled from .proto files at startup. Decoding parses each byte payload against the configured MessageDescriptor; encoding reverses the process. Use it when an input emits raw Protobuf (no Confluent schema-id prefix).

Configuration​

FieldTypeRequiredDefaultDescription
typestringyes—Fixed value "protobuf"
message_typestringyes—Fully qualified Protobuf message type name (including package), e.g. com.example.User
proto_inputsarray<string>yes—List of .proto source file paths
proto_includesarray<string>no—Include search paths used when parsing .proto files

The decode-error policy is the engine-level on_error key on codec — see Dead Letter Queues.

Examples​

input:
type: kafka
brokers:
- localhost:9092
topics:
- users
consumer_group: arkflow
start_from_latest: false
codec:
type: protobuf
message_type: message.Message
proto_inputs:
- ./examples/message.proto
codec:
type: protobuf
message_type: message.Message
proto_inputs:
- ./examples/message.proto

Notes​

  • Only proto3 scalar fields are supported: bool, int32/sint32/sfixed32, int64/sint64/sfixed64, uint32/fixed32, uint64/fixed64, float, double, string, bytes, and enum (mapped to Arrow Int32).
  • Nested messages, repeated, map, oneof, and proto3 optional fields are not supported; encountering them returns an error during encoding/decoding.
  • Decoding uses the descriptor's full field set against a single accumulated batch: every decoded field is nullable, and a message that omits a field simply yields null for that column (there is no per-message schema merge or cross-message compatibility check).