Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Kafka Share Group Protocol APIs

This document specifies the Kafka protocol APIs used for Share Groups, a new consumer model introduced in KIP-932 (Kafka 4.0+). Share Groups provide queue-like semantics where messages are distributed among consumers without client-side partition assignment.


Share Groups differ fundamentally from traditional Consumer Groups:

AspectConsumer GroupsShare Groups
Partition assignmentEach partition assigned to one consumerNo partition assignment
Message deliveryAll messages in partition to assigned consumerMessages distributed across consumers
OrderingPer-partition ordering guaranteedNo ordering guarantee
AcknowledgmentOffset-basedPer-record acknowledgment
Use caseStream processingWork queue, task distribution

API KeyNamePurpose
76ShareGroupHeartbeatMaintain membership and receive assignments
77ShareGroupDescribeDescribe share group state
API KeyNamePurpose
78ShareFetchFetch records from share group
79ShareAcknowledgeAcknowledge record processing
API KeyNamePurpose
83InitializeShareGroupStateInitialize share partition state
84ReadShareGroupStateRead share partition state
85WriteShareGroupStateWrite share partition state
86DeleteShareGroupStateDelete share partition state
87ReadShareGroupStateSummaryRead share partition state summary
API KeyNamePurpose
90DescribeShareGroupOffsetsDescribe share group offsets
91AlterShareGroupOffsetsAlter share group offsets
92DeleteShareGroupOffsetsDelete share group offsets

The ShareGroupHeartbeat API maintains share group membership. Unlike consumer groups which use separate JoinGroup/SyncGroup/Heartbeat APIs, share groups use a single heartbeat API for all coordination.

ShareGroupHeartbeatRequest =>
group_id: STRING
member_id: STRING
member_epoch: INT32
rack_id: NULLABLE_STRING
subscribed_topic_names: [STRING]
FieldTypeDescription
group_idSTRINGShare group identifier
member_idSTRINGMember ID (client-generated)
member_epochINT32Member epoch (0=join, -1=leave)
rack_idNULLABLE_STRINGRack ID (null if unchanged)
subscribed_topic_namesARRAYSubscribed topic names (null if unchanged)
ShareGroupHeartbeatResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: NULLABLE_STRING
member_id: NULLABLE_STRING
member_epoch: INT32
heartbeat_interval_ms: INT32
assignment: Assignment
Assignment =>
topic_partitions: [TopicPartition]
TopicPartition =>
topic_id: UUID
partitions: [INT32]
AspectGuarantee
Epoch fencingStale members rejected via epoch
AssignmentServer-side assignment, no leader election
Heartbeat intervalServer specifies next heartbeat timing
Versioningv0 early access removed in 4.1; v1 stable; v2 in Kafka 4.2 adds ShareAcquireMode and RENEW acknowledgement

The ShareGroupDescribe API retrieves detailed information about share groups.

ShareGroupDescribeRequest =>
group_ids: [STRING]
include_authorized_operations: BOOLEAN
ShareGroupDescribeResponse =>
throttle_time_ms: INT32
groups: [Group]
Group =>
error_code: INT16
error_message: NULLABLE_STRING
group_id: STRING
group_state: STRING
group_epoch: INT32
assignment_epoch: INT32
assignor_name: STRING
members: [Member]
authorized_operations: INT32
Member =>
member_id: STRING
rack_id: NULLABLE_STRING
member_epoch: INT32
client_id: STRING
client_host: STRING
subscribed_topic_names: [STRING]
assignment: Assignment
Assignment =>
topic_partitions: [TopicPartition]
TopicPartition =>
topic_id: UUID
topic_name: STRING
partitions: [INT32]

The ShareFetch API retrieves records from a share group. Unlike regular Fetch, records are distributed across consumers and require acknowledgment.

ShareFetchRequest =>
group_id: NULLABLE_STRING
member_id: NULLABLE_STRING
share_session_epoch: INT32
max_wait_ms: INT32
min_bytes: INT32
max_bytes: INT32
max_records: INT32
batch_size: INT32
share_acquire_mode: INT8
is_renew_ack: BOOLEAN
topics: [Topic]
forgotten_topics_data: [ForgottenTopic]
Topic =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition_index: INT32
partition_max_bytes: INT32
acknowledgement_batches: [AcknowledgementBatch]
AcknowledgementBatch =>
first_offset: INT64
last_offset: INT64
acknowledge_types: [INT8]
FieldTypeDescription
group_idSTRINGShare group identifier
share_session_epochINT32Session epoch for incremental fetch
share_acquire_modeINT80=batch-optimized, 1=record-limit. Added in Kafka 4.2 (KIP-1206, v2+)
is_renew_ackBOOLEANTrue if renew acks are present. Added in Kafka 4.2 (KIP-1222, v2+)
acknowledgement_batchesARRAYInline acknowledgments (optional)
ShareFetchResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: NULLABLE_STRING
acquisition_lock_timeout_ms: INT32
responses: [Response]
node_endpoints: [NodeEndpoint]
Response =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition_index: INT32
error_code: INT16
error_message: NULLABLE_STRING
acknowledge_error_code: INT16
acknowledge_error_message: NULLABLE_STRING
current_leader: LeaderIdAndEpoch
records: RECORDS
acquired_records: [AcquiredRecords]
AcquiredRecords =>
first_offset: INT64
last_offset: INT64
delivery_count: INT16
FieldTypeDescription
acquired_recordsARRAYRecords acquired by this consumer
delivery_countINT16Number of delivery attempts
AspectGuarantee
Record lockingFetched records locked to consumer
Delivery trackingDelivery count tracks retries
TimeoutUnacknowledged records released after timeout

The ShareAcknowledge API acknowledges processing of records fetched via ShareFetch.

ShareAcknowledgeRequest =>
group_id: NULLABLE_STRING
member_id: NULLABLE_STRING
share_session_epoch: INT32
is_renew_ack: BOOLEAN
topics: [Topic]
Topic =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition_index: INT32
acknowledgement_batches: [AcknowledgementBatch]
AcknowledgementBatch =>
first_offset: INT64
last_offset: INT64
acknowledge_types: [INT8]
ValueTypeDescription
0GAPPlaceholder for gaps
1ACCEPTSuccessfully processed
2RELEASERelease for redelivery
3REJECTReject permanently (DLQ)
4RENEWRenew acquisition lock timeout, extending processing time without releasing the record. Added in Kafka 4.2 (KIP-1222, v2+)
ShareAcknowledgeResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: NULLABLE_STRING
acquisition_lock_timeout_ms: INT32
responses: [Response]
node_endpoints: [NodeEndpoint]
Response =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition_index: INT32
error_code: INT16
error_message: NULLABLE_STRING
current_leader: LeaderIdAndEpoch
AspectGuarantee
ACCEPTRecord marked complete, not redelivered
RELEASERecord released for another consumer
REJECTRecord sent to dead letter queue (if configured)

Initializes the share partition state when a share group first accesses a partition.

InitializeShareGroupStateRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition: INT32
state_epoch: INT32
start_offset: INT64

Reads the current state of share partitions.

ReadShareGroupStateRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition: INT32
leader_epoch: INT32

Writes updated share partition state.

WriteShareGroupStateRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition: INT32
state_epoch: INT32
leader_epoch: INT32
start_offset: INT64
delivery_complete_count: INT32
state_batches: [StateBatch]
StateBatch =>
first_offset: INT64
last_offset: INT64
delivery_state: INT8
delivery_count: INT16

Deletes share partition state when cleaning up a share group.

DeleteShareGroupStateRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_id: UUID
partitions: [INT32]

Reads a summary of share partition state for monitoring.

ReadShareGroupStateSummaryRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_id: UUID
partitions: [Partition]
Partition =>
partition: INT32
leader_epoch: INT32

Describes the current offsets for a share group.

DescribeShareGroupOffsetsRequest =>
groups: [Group]
Group =>
group_id: STRING
topics: [Topic]
Topic =>
topic_name: STRING
partitions: [INT32]

Alters the offsets for a share group (administrative operation).

AlterShareGroupOffsetsRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_name: STRING
partitions: [Partition]
Partition =>
partition_index: INT32
start_offset: INT64

Deletes offset information for a share group.

DeleteShareGroupOffsetsRequest =>
group_id: STRING
topics: [Topic]
Topic =>
topic_name: STRING

FeatureMinimum Kafka Version
Share Groups (core APIs)4.0.0
ShareAcquireMode (batch_optimized, record_limit)4.2.0 (KIP-1206)
RENEW acknowledgement type4.2.0 (KIP-1222)
Share partition lag metrics4.2.0 (KIP-1226)
Additional share-group configurations4.3.0 (KAFKA-20037)
Assignment epochs for consumer/share groups4.3.0 (KIP-1251)

Share Group API Versions

Share Groups were introduced in Kafka 4.0 (KIP-932). Kafka 4.2 adds v2 of the ShareFetch and ShareAcknowledge APIs with acquisition mode control (KIP-1206) and lock timeout renewal (KIP-1222). Kafka 4.3 extends group-level configuration coverage for share groups and introduces assignment epochs (KIP-1251) for detecting stale assignment state during rebalances.