What is OffsetFetch?
Consumers call this on startup or after a rebalance to recover their last committed position, and kafka-consumer-groups.sh --describe uses it to show lag. Returns UNKNOWN_TOPIC_OR_PARTITION if the group never committed to a partition, meaning auto.offset.reset applies.
Wire Diagram
Request Header
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string
OffsetFetchRequest v2
GroupId
string
Name
string
PartitionIndexes
[]int32
Schema & Example
Schema { "GroupId": string, "Topics": [{ "Name": string, "PartitionIndexes": [int32] }]? }
Example { "GroupId": "order-processors", "Topics": [{ "Name": "orders", "PartitionIndexes": [1, 2, 3] }]? }