Skip to content

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

Share Groups and Kafka Queues

Share groups provide queue-style record processing in Apache Kafka. Consumers in a share group cooperatively process records without assigning each partition exclusively to one consumer.

KIP-932 introduced share groups as a preview in Kafka 4.1. They became production-ready in Kafka 4.2. Use share groups for independent work items that can be processed concurrently. Use a traditional consumer group when partition ordering, direct offset control, or transactional consume-process-produce semantics are required.


A consumer group assigns each partition to one group member at a time. This preserves partition order, but it also limits active consumers to the number of partitions. Increasing the partition count solely to obtain more workers changes key distribution and increases cluster overhead.

A share group removes that one-partition-to-one-member constraint. Multiple members can acquire records from the same partition, so worker concurrency can exceed the partition count.

CharacteristicConsumer groupShare group
Unit assigned to a memberPartitionAcquired records from one or more partitions
Members per partitionOne active memberMultiple members
Maximum useful workersBounded by partition countCan exceed partition count
OrderingPartition order can be preservedStrict partition order is not guaranteed
Progress trackingCommitted offset per partitionBroker-managed record state and share-partition start offset
Failure recoveryPartition reassignment and offset replayAcquisition-lock expiry and record redelivery
CompletionOffset commitImplicit or explicit acknowledgement
Transactional consume-process-produceSupported with a transactional producerNot supported as a replacement for consumer-group transactions

Separate share groups consume the same topic independently, just as separate consumer groups do. Within one share group, each record is delivered to one member at a time.


When a share consumer polls, the broker acquires available records for that member. An acquisition lock prevents another member of the same share group from receiving those records while they are being processed.

The default lock duration is 30 seconds. The group-level share.record.lock.duration.ms setting controls the duration within the broker’s configured minimum and maximum. If processing takes longer, an explicit-mode consumer can renew the lock.

Record stateMeaningNext action
AvailableThe record can be deliveredA poll acquires it for one member
AcquiredOne member holds a time-limited lockAccept, release, reject, renew, or allow the lock to expire
AcknowledgedProcessing completed successfullyTerminal state; the group does not redeliver it
ArchivedProcessing was rejected or the delivery limit was reachedTerminal state; eligible for a configured Kafka 4.4+ DLQ

The broker limits the number of acquired records per topic-partition and share group. When the limit is reached, fetches pause for that partition until acknowledgements or expired locks reduce the number of acquired records. This bounds in-flight state and prevents failed consumers from blocking delivery indefinitely.


The share.acknowledgement.mode client setting selects implicit or explicit acknowledgement.

Implicit mode is the default. Polling again implicitly accepts records returned by the previous poll and commits those acknowledgements asynchronously. Applications can use commitSync() or commitAsync() when they need an explicit acknowledgement-commit point for the batch.

Implicit mode is concise, but every record in the batch receives the same successful outcome. Use it only when the application finishes the entire batch before polling again.

Explicit mode lets the application choose an outcome for each record before the next poll:

AcknowledgementResult
ACCEPTMark processing successful; do not redeliver
RELEASEMake the record available for another delivery attempt
REJECTMark the record unprocessable; do not attempt normal delivery again
RENEWExtend the acquisition lock while processing continues

If the consumer does nothing, the acquisition lock expires and the record becomes available again. A crash can therefore cause redelivery. Handlers should remain idempotent even when using ACCEPT.


The broker counts delivery attempts for each record. share.delivery.count.limit controls how many attempts a share group permits, within cluster-defined bounds.

A record is archived when it is rejected or released after reaching the delivery limit. In Kafka 4.4, an archived record can be routed to a broker-managed dead-letter queue when:

  • the cluster feature level is at least share.version=2;
  • the share group has a DLQ topic configured; and
  • the DLQ topic is automatically created or explicitly enabled for share-group DLQ writes.

Without a configured DLQ, archived records are no longer delivered to the share group but are not copied elsewhere. See Dead Letter Queues for the complete behavior and configuration model.


Share consumers do not use auto.offset.reset, seek(), or consumer-group offset commits. The share group’s share.auto.offset.reset configuration determines the initial position when no share-group state exists.

Administrators can reset the offsets of an inactive share group with kafka-share-groups.sh. Kafka 4.4 can also initialize share-group offsets from a file, including offsets exported from an inactive consumer group. These are administrative recovery and migration operations, not per-consumer replay controls.

Share-group progress is stored in the automatically created __share_group_state internal topic. Its default replication and minimum-ISR settings assume at least three brokers. Development clusters with fewer brokers must adjust the corresponding broker settings before first use.


Share groups provide controlled at-least-once processing when failed or timed-out records are released for redelivery. They do not make an external side effect atomic with a record acknowledgement.

Design share consumers to handle duplicates:

  • Use a stable event or command ID as an idempotency key.
  • Make database writes conditional or use uniqueness constraints.
  • Renew the acquisition lock for long-running work rather than allowing concurrent redelivery.
  • Reject deterministic poison records instead of retrying indefinitely.
  • Configure and monitor a DLQ when records must remain available for investigation.

Do not use a share group when an application depends on strict per-key order or Kafka transactions that atomically publish output and commit consumer-group offsets. See Delivery Semantics for those patterns.


Kafka versionShare-group status
4.0 and earlierNot available
4.1Preview; enabled with share.version=1
4.2Production-ready core feature set, including lock renewal and share-group lag metrics
4.3Additional dynamic limits for delivery count, record locks, and assignment intervals
4.4Broker-managed DLQs with share.version=2; offset initialization from a file

Mark examples and operational instructions with their minimum Kafka version. In particular, do not present broker-managed DLQs as Kafka 4.2 behavior: they require Kafka 4.4 and share.version=2.