WriteShareGroupState
This page encodes the smallest legal instance of the request and the response: numeric fields are zero, strings and byte arrays are empty, every array carries exactly one sample element, and any records field holds one empty 61-byte RecordBatch v2. Version 0 is a flexible version, so every struct is terminated by a uvarint tagged-field count and strings and arrays carry compact length-plus-one prefixes. Sizes below include the leading int32 size prefix.
- API key
- 85
- Encoded at
- v0
- Flexible versions
- 0+
- Headers
- req v2, resp v1
- Request versions
- 0
- Response versions
- 0
- Request size
- 78 bytes
- Response size
- 37 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
WriteShareGroupStateRequest v0, request header v2, 78 bytes on the wire
byte layout (78 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
0020
0030
0040
object tree
WriteShareGroupStateRequest message v0 [0x0000, 78B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 74 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v2 [0x0004, 11B] common request header | +-- request_api_key int16 = 85 (WriteShareGroupState) [0x0004, 2B] numeric id of the API being invoked | +-- request_api_version int16 = 0 [0x0006, 2B] version of the API being invoked | +-- correlation_id int32 = 0 [0x0008, 4B] echoed back by the broker in the response | +-- client_id nullable_string = "" (int16 len=0) [0x000c, 2B] always a non-flexible int16-prefixed string | +-- tagged_fields uvarint = 0 [0x000e, 1B] number of tagged fields in the header +-- WriteShareGroupStateRequest struct [0x000f, 63B] message body, version 0 +-- GroupId string = "" (compact, len+1=1) [0x000f, 1B] The group identifier. +-- Topics []WriteStateData = 1 element [0x0010, 61B] The data for the topics. | +-- length uvarint = 2 (compact, n+1) [0x0010, 1B] one sample element follows | +-- WriteStateData[0] WriteStateData = struct [0x0011, 60B] | +-- TopicId uuid = 00000000-0000-0000-0000-000000000000 [0x0011, 16B] The topic identifier. | +-- Partitions []PartitionData = 1 element [0x0021, 43B] The data for the partitions. | | +-- length uvarint = 2 (compact, n+1) [0x0021, 1B] one sample element follows | | +-- PartitionData[0] PartitionData = struct [0x0022, 42B] | | +-- Partition int32 = 0 [0x0022, 4B] The partition index. | | +-- StateEpoch int32 = 0 [0x0026, 4B] The state epoch for this share-partition. | | +-- LeaderEpoch int32 = 0 [0x002a, 4B] The leader epoch of the share-partition. | | +-- StartOffset int64 = 0 [0x002e, 8B] The share-partition start offset, or -1 if the start offset is not being wr... | | +-- StateBatches []StateBatch = 1 element [0x0036, 21B] The state batches for the share-partition. | | | +-- length uvarint = 2 (compact, n+1) [0x0036, 1B] one sample element follows | | | +-- StateBatch[0] StateBatch = struct [0x0037, 20B] | | | +-- FirstOffset int64 = 0 [0x0037, 8B] The base offset of this state batch. | | | +-- LastOffset int64 = 0 [0x003f, 8B] The last offset of this state batch. | | | +-- DeliveryState int8 = 0 [0x0047, 1B] The state - 0:Available,2:Acked,4:Archived. | | | +-- DeliveryCount int16 = 0 [0x0048, 2B] The delivery count. | | | +-- tagged_fields uvarint = 0 [0x004a, 1B] number of tagged fields in this struct | | +-- tagged_fields uvarint = 0 [0x004b, 1B] number of tagged fields in this struct | +-- tagged_fields uvarint = 0 [0x004c, 1B] number of tagged fields in this struct +-- tagged_fields uvarint = 0 [0x004d, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 85, "type": "request", "listeners": ["broker"], "name": "WriteShareGroupStateRequest", "validVersions": "0", "flexibleVersions": "0+", "latestVersionUnstable": true, "fields": [ { "name": "GroupId", "type": "string", "versions": "0+", "about":"The group identifier." }, { "name": "Topics", "type": "[]WriteStateData", "versions": "0+", "about": "The data for the topics.", "fields": [ { "name": "TopicId", "type": "uuid", "versions": "0+", "about": "The topic identifier." }, { "name": "Partitions", "type": "[]PartitionData", "versions": "0+", "about": "The data for the partitions.", "fields": [ { "name": "Partition", "type": "int32", "versions": "0+", "about": "The partition index." }, { "name": "StateEpoch", "type": "int32", "versions": "0+", "about": "The state epoch for this share-partition." }, { "name": "LeaderEpoch", "type": "int32", "versions": "0+", "about": "The leader epoch of the share-partition." }, { "name": "StartOffset", "type": "int64", "versions": "0+", "about": "The share-partition start offset, or -1 if the start offset is not being written." }, { "name": "StateBatches", "type": "[]StateBatch", "versions": "0+", "about": "The state batches for the share-partition.", "fields": [ { "name": "FirstOffset", "type": "int64", "versions": "0+", "about": "The base offset of this state batch." }, { "name": "LastOffset", "type": "int64", "versions": "0+", "about": "The last offset of this state batch." }, { "name": "DeliveryState", "type": "int8", "versions": "0+", "about": "The state - 0:Available,2:Acked,4:Archived." }, { "name": "DeliveryCount", "type": "int16", "versions": "0+", "about": "The delivery count." } ]} ]} ]} ] }
Response
WriteShareGroupStateResponse v0, response header v1, 37 bytes on the wire
byte layout (37 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
0020
object tree
WriteShareGroupStateResponse message v0 [0x0000, 37B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 33 [0x0000, 4B] number of bytes that follow, patched after encoding +-- ResponseHeader v1 [0x0004, 5B] common response header | +-- correlation_id int32 = 0 [0x0004, 4B] matches the correlation_id of the request | +-- tagged_fields uvarint = 0 [0x0008, 1B] number of tagged fields in the header +-- WriteShareGroupStateResponse struct [0x0009, 28B] message body, version 0 +-- Results []WriteStateResult = 1 element [0x0009, 27B] The write results. | +-- length uvarint = 2 (compact, n+1) [0x0009, 1B] one sample element follows | +-- WriteStateResult[0] WriteStateResult = struct [0x000a, 26B] | +-- TopicId uuid = 00000000-0000-0000-0000-000000000000 [0x000a, 16B] The topic identifier. | +-- Partitions []PartitionResult = 1 element [0x001a, 9B] The results for the partitions. | | +-- length uvarint = 2 (compact, n+1) [0x001a, 1B] one sample element follows | | +-- PartitionResult[0] PartitionResult = struct [0x001b, 8B] | | +-- Partition int32 = 0 [0x001b, 4B] The partition index. | | +-- ErrorCode int16 = 0 [0x001f, 2B] The error code, or 0 if there was no error. | | +-- ErrorMessage string = "" (compact, len+1=1) [0x0021, 1B] The error message, or null if there was no error. | | +-- tagged_fields uvarint = 0 [0x0022, 1B] number of tagged fields in this struct | +-- tagged_fields uvarint = 0 [0x0023, 1B] number of tagged fields in this struct +-- tagged_fields uvarint = 0 [0x0024, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 85, "type": "response", "name": "WriteShareGroupStateResponse", "validVersions": "0", "flexibleVersions": "0+", // - NOT_COORDINATOR (version 0+) // - COORDINATOR_NOT_AVAILABLE (version 0+) // - COORDINATOR_LOAD_IN_PROGRESS (version 0+) // - GROUP_ID_NOT_FOUND (version 0+) // - UNKNOWN_TOPIC_OR_PARTITION (version 0+) // - FENCED_STATE_EPOCH (version 0+) // - INVALID_REQUEST (version 0+) "fields": [ { "name": "Results", "type": "[]WriteStateResult", "versions": "0+", "about": "The write results.", "fields": [ { "name": "TopicId", "type": "uuid", "versions": "0+", "about": "The topic identifier." }, { "name": "Partitions", "type": "[]PartitionResult", "versions": "0+", "about" : "The results for the partitions.", "fields": [ { "name": "Partition", "type": "int32", "versions": "0+", "about": "The partition index." }, { "name": "ErrorCode", "type": "int16", "versions": "0+", "about": "The error code, or 0 if there was no error." }, { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "The error message, or null if there was no error." } ]} ]} ] }