Kafka Share Groups

Learn how to manage Kafka Share Groups (Queues).

This section describes the resource definition format for KafkaShareGroup entities, which can be used to manage the share groups (Queues, KIP-932) of a specific Kafka cluster.

Listing KafkaShareGroup

You can retrieve the state of Kafka Share Groups using the jikkou get kafkasharegroups (or jikkou get ksg) command.

Examples

(command)

$ jikkou get kafkasharegroups --in-states STABLE --offsets

(output)

---
apiVersion: "kafka.jikkou.io/v1"
kind: "KafkaShareGroup"
metadata:
  name: "my-share-group"
spec:
  configs:
    share.auto.offset.reset: "earliest"
status:
  state: "STABLE"
  members:
    - memberId: "share-consumer-b103994e-bcd5-4236-9d03-97065057e594"
      clientId: "share-consumer"
      host: "/127.0.0.1"
      rackId: "rack-1"
      assignments:
        - "my-topic-0"
  offsets:
    - topic: "my-topic"
      partition: 0
      offset: 0
  coordinator:
    id: "101"
    host: "localhost"
    port: 9092

Managing share group configuration

The spec.configs map lets you declaratively manage the dynamic group configuration of a share group (e.g. share.auto.offset.reset, share.record.lock.duration.ms, share.isolation.level). These are applied against the Kafka GROUP configuration resource and are reconciled like topic configs (drift detection + incremental alter).

apiVersion: "kafka.jikkou.io/v1"
kind: "KafkaShareGroup"
metadata:
  name: "orders-queue"
spec:
  configs:
    share.record.lock.duration.ms: 30000
    share.auto.offset.reset: "earliest"

Apply it with:

$ jikkou apply --files orders-queue.yaml

By default, group configs present on the cluster but absent from the resource are removed (config-delete-orphans=true). Set it to false to leave externally-managed configs untouched.

Deleting KafkaShareGroup

A share group can be deleted by reconciling a resource flagged for deletion (jikkou delete), which removes the group via the AdminClient deleteShareGroups API.

Resetting share group offsets

See the KafkaShareGroupsResetOffsets action to reset the Share-Partition Start Offset (SPSO) of one or more share groups.