What is ShareFetch?
The main data path for share group consumers, fetching records and acknowledging previously fetched ones in a single round-trip (KIP-932). Records are locked on fetch with an acquisition timeout; if a consumer doesn't acknowledge within that window, the records become available for re-delivery.
Wire Diagram
Request Header · flexible
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string (compact)
tagged
var
ShareFetchRequest v1
GroupId?
string (compact)
MemberId?
string (compact)
ShareSessionEpoch
int32 · 4B
MaxWaitMs
int32 · 4B
MinBytes
int32 · 4B
MaxBytes
int32 · 4B
MaxRecords
int32 · 4B
BatchSize
int32 · 4B
tagged
var
TopicId
uuid · 16B
tagged
var
PartitionIndex
int32 · 4B
tagged
var
FirstOffset
int64 · 8B
LastOffset
int64 · 8B
AcknowledgeTypes
[]int8
tagged
var
TopicId
uuid · 16B
Partitions
[]int32
tagged
var
Schema & Example
Schema { "GroupId": string?, "MemberId": string?, "ShareSessionEpoch": int32, "MaxWaitMs": int32, "MinBytes": int32, "MaxBytes": int32, "MaxRecords": int32, "BatchSize": int32, "Topics": [{ "TopicId": uuid, "Partitions": [{ "PartitionIndex": int32, "AcknowledgementBatches": [{ "FirstOffset": int64, "LastOffset": int64, "AcknowledgeTypes": [int8] }] }] }], "ForgottenTopicsData": [{ "TopicId": uuid, "Partitions": [int32] }] }
Example { "GroupId": "order-processors", "MemberId": "consumer-1-abc123", "ShareSessionEpoch": 12, "MaxWaitMs": 500, "MinBytes": 65536, "MaxBytes": 65536, "MaxRecords": 0, "BatchSize": 1048576, "Topics": [{ "TopicId": "550e8400-e29b-41d4-a716-446655440000", "Partitions": [{ "PartitionIndex": 3, "AcknowledgementBatches": [{ "FirstOffset": 150382, "LastOffset": 150382, "AcknowledgeTypes": [...] }] }] }], "ForgottenTopicsData": [{ "TopicId": "550e8400-e29b-41d4-a716-446655440000", "Partitions": [1, 2, 3] }] }