SyncGroup
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 5 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
- 14
- Encoded at
- v5
- Flexible versions
- 4+
- Headers
- req v2, resp v1
- Request versions
- 0-5
- Response versions
- 0-5
- Request size
- 29 bytes
- Response size
- 19 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
SyncGroupRequest v5, request header v2, 29 bytes on the wire
byte layout (29 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
object tree
SyncGroupRequest message v5 [0x0000, 29B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 25 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v2 [0x0004, 11B] common request header | +-- request_api_key int16 = 14 (SyncGroup) [0x0004, 2B] numeric id of the API being invoked | +-- request_api_version int16 = 5 [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 +-- SyncGroupRequest struct [0x000f, 14B] message body, version 5 +-- GroupId string = "" (compact, len+1=1) [0x000f, 1B] The unique group identifier. +-- GenerationId int32 = 0 [0x0010, 4B] The generation of the group. +-- MemberId string = "" (compact, len+1=1) [0x0014, 1B] The member ID assigned by the group. +-- GroupInstanceId string = "" (compact, len+1=1) [0x0015, 1B] The unique identifier of the consumer instance provided by end user. +-- ProtocolType string = "" (compact, len+1=1) [0x0016, 1B] The group protocol type. +-- ProtocolName string = "" (compact, len+1=1) [0x0017, 1B] The group protocol name. +-- Assignments []SyncGroupRequestAssignment = 1 element [0x0018, 4B] Each assignment. | +-- length uvarint = 2 (compact, n+1) [0x0018, 1B] one sample element follows | +-- SyncGroupRequestAssignment[0] SyncGroupRequestAssignment = struct [0x0019, 3B] | +-- MemberId string = "" (compact, len+1=1) [0x0019, 1B] The ID of the member to assign. | +-- Assignment bytes = empty (compact, len+1=1) [0x001a, 1B] The member assignment. | +-- tagged_fields uvarint = 0 [0x001b, 1B] number of tagged fields in this struct +-- tagged_fields uvarint = 0 [0x001c, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 14, "type": "request", "listeners": ["broker"], "name": "SyncGroupRequest", // Versions 1 and 2 are the same as version 0. // // Starting from version 3, we add a new field called groupInstanceId to indicate member identity across restarts. // // Version 4 is the first flexible version. // // Starting from version 5, the client sends the Protocol Type and the Protocol Name // to the broker (KIP-559). The broker will reject the request if they are inconsistent // with the Type and Name known by the broker. "validVersions": "0-5", "flexibleVersions": "4+", "fields": [ { "name": "GroupId", "type": "string", "versions": "0+", "entityType": "groupId", "about": "The unique group identifier." }, { "name": "GenerationId", "type": "int32", "versions": "0+", "about": "The generation of the group." }, { "name": "MemberId", "type": "string", "versions": "0+", "about": "The member ID assigned by the group." }, { "name": "GroupInstanceId", "type": "string", "versions": "3+", "nullableVersions": "3+", "default": "null", "about": "The unique identifier of the consumer instance provided by end user." }, { "name": "ProtocolType", "type": "string", "versions": "5+", "nullableVersions": "5+", "default": "null", "ignorable": true, "about": "The group protocol type." }, { "name": "ProtocolName", "type": "string", "versions": "5+", "nullableVersions": "5+", "default": "null", "ignorable": true, "about": "The group protocol name." }, { "name": "Assignments", "type": "[]SyncGroupRequestAssignment", "versions": "0+", "about": "Each assignment.", "fields": [ { "name": "MemberId", "type": "string", "versions": "0+", "about": "The ID of the member to assign." }, { "name": "Assignment", "type": "bytes", "versions": "0+", "about": "The member assignment." } ]} ] }
Response
SyncGroupResponse v5, response header v1, 19 bytes on the wire
byte layout (19 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
object tree
SyncGroupResponse message v5 [0x0000, 19B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 15 [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 +-- SyncGroupResponse struct [0x0009, 10B] message body, version 5 +-- ThrottleTimeMs int32 = 0 [0x0009, 4B] The duration in milliseconds for which the request was throttled due to a q... +-- ErrorCode int16 = 0 [0x000d, 2B] The error code, or 0 if there was no error. +-- ProtocolType string = "" (compact, len+1=1) [0x000f, 1B] The group protocol type. +-- ProtocolName string = "" (compact, len+1=1) [0x0010, 1B] The group protocol name. +-- Assignment bytes = empty (compact, len+1=1) [0x0011, 1B] The member assignment. +-- tagged_fields uvarint = 0 [0x0012, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 14, "type": "response", "name": "SyncGroupResponse", // Version 1 adds throttle time. // // Starting in version 2, on quota violation, brokers send out responses before throttling. // // Starting from version 3, syncGroupRequest supports a new field called groupInstanceId to indicate member identity across restarts. // // Version 4 is the first flexible version. // // Starting from version 5, the broker sends back the Protocol Type and the Protocol Name // to the client (KIP-559). "validVersions": "0-5", "flexibleVersions": "4+", "fields": [ { "name": "ThrottleTimeMs", "type": "int32", "versions": "1+", "ignorable": true, "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." }, { "name": "ErrorCode", "type": "int16", "versions": "0+", "about": "The error code, or 0 if there was no error." }, { "name": "ProtocolType", "type": "string", "versions": "5+", "nullableVersions": "5+", "default": "null", "ignorable": true, "about": "The group protocol type." }, { "name": "ProtocolName", "type": "string", "versions": "5+", "nullableVersions": "5+", "default": "null", "ignorable": true, "about": "The group protocol name." }, { "name": "Assignment", "type": "bytes", "versions": "0+", "about": "The member assignment." } ] }