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
Response Header
message_size
int32 · 4B
correlation_id
int32 · 4B
OffsetFetchResponse v4
ThrottleTimeMs
int32 · 4B
ErrorCode
int16 · 2B
Name
string
PartitionIndex
int32 · 4B
CommittedOffset
int64 · 8B
Metadata?
string
ErrorCode
int16 · 2B
Schema & Example
Schema { "ThrottleTimeMs": int32, "Topics": [{ "Name": string, "Partitions": [{ "PartitionIndex": int32, "CommittedOffset": int64, "Metadata": string?, "ErrorCode": int16 }] }], "ErrorCode": int16 }
Example { "ThrottleTimeMs": 0, "Topics": [{ "Name": "orders", "Partitions": [{ "PartitionIndex": 3, "CommittedOffset": 150382, "Metadata": "", "ErrorCode": 0 }] }], "ErrorCode": 0 }