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.
| Version | Kafka | Changes |
|---|---|---|
| OffsetFetchRequest | ||
| v1 | 2.2 | the broker supports fetching offsets from the internal __consumer_offsets topic. |
| v2 | 2.2 | ~ Topics became nullablethe request can contain a null topics array to indicate that offsets for all topics should be fetched. It also returns a top level error code for group or coordinator level errors. |
| v3 | 2.2 | 4, and 5 are the same as version 2. |
| v4 | 2.2 | No changes |
| v5 | 2.2 | No changes |
| v6 | 2.4 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| v7 | 2.5 | + RequireStable boolis adding the require stable flag. |
| v8 | 3.0 | + Groups []OffsetFetchRequestGroup+ GroupId string+ Topics []OffsetFetchRequestTopics+ Name string+ PartitionIndexes []int32- GroupId string- Topics []OffsetFetchRequestTopic- Name string- PartitionIndexes []int32is adding support for fetching offsets for multiple groups at a time. |
| v9 | 3.7 | + MemberId string+ MemberEpoch int32is the first version that can be used with the new consumer group protocol (KIP-848). It adds the MemberId and MemberEpoch fields. Those are filled in and validated when the new consumer protocol is used. |
| v10 | 4.1 | + TopicId uuid- Name stringadds support for topic ids and removes support for topic names (KIP-848). |
| OffsetFetchResponse | ||
| v1 | 2.2 | is the same as version 0. |
| v2 | 2.2 | + ErrorCode int16adds a top-level error code. |
| v3 | 2.2 | + ThrottleTimeMs int32adds the throttle time. |
| v4 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v5 | 2.2 | + CommittedLeaderEpoch int32adds the leader epoch to the committed offset. |
| v6 | 2.4 | ~ Flexible encoding enabled FLEXIBLE is the first flexible version. |
| v7 | 2.5 | adds pending offset commit as new error response on partition level. |
| v8 | 3.0 | + Groups []OffsetFetchResponseGroup+ GroupId string+ Topics []OffsetFetchResponseTopics+ Name string+ Partitions []OffsetFetchResponsePartitions+ PartitionIndex int32+ CommittedOffset int64+ CommittedLeaderEpoch int32+ Metadata string+ ErrorCode int16+ ErrorCode int16- Topics []OffsetFetchResponseTopic- Name string- Partitions []OffsetFetchResponsePartition- PartitionIndex int32- CommittedOffset int64- CommittedLeaderEpoch int32- Metadata string- ErrorCode int16- ErrorCode int16is adding support for fetching offsets for multiple groups |
| v9 | 3.7 | is the first version that can be used with the new consumer group protocol (KIP-848). The response is the same as version 8 but can return STALE_MEMBER_EPOCH and UNKNOWN_MEMBER_ID errors when the new consumer group protocol is used. |
| v10 | 4.1 | + TopicId uuid- Name stringadds support for topic ids and removes support for topic names (KIP-848). |