conduktor.io ↗

Kafka OffsetFetch Response Wire Format v10 — Binary Protocol Layout

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.

Related Errors

COORDINATOR_NOT_AVAILABLE · GROUP_AUTHORIZATION_FAILED · INVALID_GROUP_ID · NOT_COORDINATOR · TOPIC_AUTHORIZATION_FAILED · UNKNOWN_TOPIC_ID · UNSTABLE_OFFSET_COMMIT

Wire Diagram

Response Header · flexible
message_size int32 · 4B
correlation_id int32 · 4B
tagged var
OffsetFetchResponse v10
ThrottleTimeMs int32 · 4B
Groups array
tagged var
GroupId string (compact)
Topics array
ErrorCode int16 · 2B
tagged var
TopicId uuid · 16B
Partitions array
tagged var
PartitionIndex int32 · 4B
CommittedOffset int64 · 8B
CommittedLeaderEpoch int32 · 4B
Metadata? string (compact)
ErrorCode int16 · 2B
tagged var

Schema & Example

Schema
{
  "ThrottleTimeMs": int32,
  "Groups": [{
      "GroupId": string,
      "Topics": [{
          "TopicId": uuid,
          "Partitions": [{
              "PartitionIndex": int32,
              "CommittedOffset": int64,
              "CommittedLeaderEpoch": int32,
              "Metadata": string?,
              "ErrorCode": int16
          }]
      }],
      "ErrorCode": int16
  }]
}
Example
{
  "ThrottleTimeMs": 0,
  "Groups": [{
      "GroupId": "order-processors",
      "Topics": [{
          "TopicId": "550e8400-e29b-41d4-a716-446655440000",
          "Partitions": [{
              "PartitionIndex": 3,
              "CommittedOffset": 150382,
              "CommittedLeaderEpoch": 12,
              "Metadata": "",
              "ErrorCode": 0
          }]
      }],
      "ErrorCode": 0
  }]
}