ConsumerGroupHeartbeat
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 1 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
- 68
- Encoded at
- v1
- Flexible versions
- 0+
- Headers
- req v2, resp v1
- Request versions
- 0-1
- Response versions
- 0-1
- Request size
- 55 bytes
- Response size
- 50 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
ConsumerGroupHeartbeatRequest v1, request header v2, 55 bytes on the wire
byte layout (55 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
object tree
ConsumerGroupHeartbeatRequest message v1 [0x0000, 55B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 51 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v2 [0x0004, 11B] common request header | +-- request_api_key int16 = 68 (ConsumerGroupHeartbeat) [0x0004, 2B] numeric id of the API being invoked | +-- request_api_version int16 = 1 [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 +-- ConsumerGroupHeartbeatRequest struct [0x000f, 40B] message body, version 1 +-- GroupId string = "" (compact, len+1=1) [0x000f, 1B] The group identifier. +-- MemberId string = "" (compact, len+1=1) [0x0010, 1B] The member id generated by the consumer. The member id must be kept during ... +-- MemberEpoch int32 = 0 [0x0011, 4B] The current member epoch; 0 to join the group; -1 to leave the group; -2 to... +-- InstanceId string = "" (compact, len+1=1) [0x0015, 1B] null if not provided or if it didn't change since the last heartbeat; the i... +-- RackId string = "" (compact, len+1=1) [0x0016, 1B] null if not provided or if it didn't change since the last heartbeat; the r... +-- RebalanceTimeoutMs int32 = 0 [0x0017, 4B] -1 if it didn't change since the last heartbeat; the maximum time in millis... +-- SubscribedTopicNames []string = 1 element [0x001b, 2B] null if it didn't change since the last heartbeat; the subscribed topic nam... | +-- length uvarint = 2 (compact, n+1) [0x001b, 1B] one sample element follows | +-- string[0] string = "" (compact, len+1=1) [0x001c, 1B] +-- SubscribedTopicRegex string = "" (compact, len+1=1) [0x001d, 1B] null if it didn't change since the last heartbeat; the subscribed topic reg... +-- ServerAssignor string = "" (compact, len+1=1) [0x001e, 1B] null if not used or if it didn't change since the last heartbeat; the serve... +-- TopicPartitions []TopicPartitions = 1 element [0x001f, 23B] null if it didn't change since the last heartbeat; the partitions owned by ... | +-- length uvarint = 2 (compact, n+1) [0x001f, 1B] one sample element follows | +-- TopicPartitions[0] TopicPartitions = struct [0x0020, 22B] | +-- TopicId uuid = 00000000-0000-0000-0000-000000000000 [0x0020, 16B] The topic ID. | +-- Partitions []int32 = 1 element [0x0030, 5B] The partitions. | | +-- length uvarint = 2 (compact, n+1) [0x0030, 1B] one sample element follows | | +-- int32[0] int32 = 0 [0x0031, 4B] | +-- tagged_fields uvarint = 0 [0x0035, 1B] number of tagged fields in this struct +-- tagged_fields uvarint = 0 [0x0036, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 68, "type": "request", "listeners": ["broker"], "name": "ConsumerGroupHeartbeatRequest", // Version 1 adds SubscribedTopicRegex (KIP-848), and requires the consumer to generate their own Member ID (KIP-1082) "validVersions": "0-1", "flexibleVersions": "0+", "fields": [ { "name": "GroupId", "type": "string", "versions": "0+", "entityType": "groupId", "about": "The group identifier." }, { "name": "MemberId", "type": "string", "versions": "0+", "about": "The member id generated by the consumer. The member id must be kept during the entire lifetime of the consumer process." }, { "name": "MemberEpoch", "type": "int32", "versions": "0+", "about": "The current member epoch; 0 to join the group; -1 to leave the group; -2 to indicate that the static member will rejoin." }, { "name": "InstanceId", "type": "string", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "null if not provided or if it didn't change since the last heartbeat; the instance Id otherwise." }, { "name": "RackId", "type": "string", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "null if not provided or if it didn't change since the last heartbeat; the rack ID of consumer otherwise." }, { "name": "RebalanceTimeoutMs", "type": "int32", "versions": "0+", "default": -1, "about": "-1 if it didn't change since the last heartbeat; the maximum time in milliseconds that the coordinator will wait on the member to revoke its partitions otherwise." }, { "name": "SubscribedTopicNames", "type": "[]string", "versions": "0+", "nullableVersions": "0+", "default": "null", "entityType": "topicName", "about": "null if it didn't change since the last heartbeat; the subscribed topic names otherwise." }, { "name": "SubscribedTopicRegex", "type": "string", "versions": "1+", "nullableVersions": "1+", "default": "null", "about": "null if it didn't change since the last heartbeat; the subscribed topic regex otherwise." }, { "name": "ServerAssignor", "type": "string", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "null if not used or if it didn't change since the last heartbeat; the server side assignor to use otherwise." }, { "name": "TopicPartitions", "type": "[]TopicPartitions", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "null if it didn't change since the last heartbeat; the partitions owned by the member.", "fields": [ { "name": "TopicId", "type": "uuid", "versions": "0+", "about": "The topic ID." }, { "name": "Partitions", "type": "[]int32", "versions": "0+", "about": "The partitions." } ]} ] }
Response
ConsumerGroupHeartbeatResponse v1, response header v1, 50 bytes on the wire
byte layout (50 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
object tree
ConsumerGroupHeartbeatResponse message v1 [0x0000, 50B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 46 [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 +-- ConsumerGroupHeartbeatResponse struct [0x0009, 41B] message body, version 1 +-- 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 top-level error code, or 0 if there was no error. +-- ErrorMessage string = "" (compact, len+1=1) [0x000f, 1B] The top-level error message, or null if there was no error. +-- MemberId string = "" (compact, len+1=1) [0x0010, 1B] The member id is generated by the consumer starting from version 1, while i... +-- MemberEpoch int32 = 0 [0x0011, 4B] The member epoch. +-- HeartbeatIntervalMs int32 = 0 [0x0015, 4B] The heartbeat interval in milliseconds. +-- Assignment Assignment = struct [0x0019, 24B] null if not provided; the assignment otherwise. | +-- TopicPartitions []TopicPartitions = 1 element [0x0019, 23B] The partitions assigned to the member that can be used immediately. | | +-- length uvarint = 2 (compact, n+1) [0x0019, 1B] one sample element follows | | +-- TopicPartitions[0] TopicPartitions = struct [0x001a, 22B] | | +-- TopicId uuid = 00000000-0000-0000-0000-000000000000 [0x001a, 16B] The topic ID. | | +-- Partitions []int32 = 1 element [0x002a, 5B] The partitions. | | | +-- length uvarint = 2 (compact, n+1) [0x002a, 1B] one sample element follows | | | +-- int32[0] int32 = 0 [0x002b, 4B] | | +-- tagged_fields uvarint = 0 [0x002f, 1B] number of tagged fields in this struct | +-- tagged_fields uvarint = 0 [0x0030, 1B] number of tagged fields in this struct +-- tagged_fields uvarint = 0 [0x0031, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 68, "type": "response", "name": "ConsumerGroupHeartbeatResponse", "validVersions": "0-1", "flexibleVersions": "0+", // Supported errors: // - GROUP_AUTHORIZATION_FAILED (version 0+) // - NOT_COORDINATOR (version 0+) // - COORDINATOR_NOT_AVAILABLE (version 0+) // - COORDINATOR_LOAD_IN_PROGRESS (version 0+) // - INVALID_REQUEST (version 0+) // - UNKNOWN_MEMBER_ID (version 0+) // - FENCED_MEMBER_EPOCH (version 0+) // - UNSUPPORTED_ASSIGNOR (version 0+) // - UNRELEASED_INSTANCE_ID (version 0+) // - GROUP_MAX_SIZE_REACHED (version 0+) // - TOPIC_AUTHORIZATION_FAILED (version 0+) // - INVALID_REGULAR_EXPRESSION (version 1+) "fields": [ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+", "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 top-level error code, or 0 if there was no error." }, { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "The top-level error message, or null if there was no error." }, { "name": "MemberId", "type": "string", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "The member id is generated by the consumer starting from version 1, while in version 0, it can be provided by users or generated by the group coordinator." }, { "name": "MemberEpoch", "type": "int32", "versions": "0+", "about": "The member epoch." }, { "name": "HeartbeatIntervalMs", "type": "int32", "versions": "0+", "about": "The heartbeat interval in milliseconds." }, { "name": "Assignment", "type": "Assignment", "versions": "0+", "nullableVersions": "0+", "default": "null", "about": "null if not provided; the assignment otherwise.", "fields": [ { "name": "TopicPartitions", "type": "[]TopicPartitions", "versions": "0+", "about": "The partitions assigned to the member that can be used immediately." } ]} ], "commonStructs": [ { "name": "TopicPartitions", "versions": "0+", "fields": [ { "name": "TopicId", "type": "uuid", "versions": "0+", "about": "The topic ID." }, { "name": "Partitions", "type": "[]int32", "versions": "0+", "about": "The partitions." } ]} ] }