Kafka: __consumer_offsets is a compacted internal topic

Group offsets are stored in Kafka itself, which is why they survive a broker restart.

Code
kafka-console-consumer.sh --bootstrap-server localhost:9092 \
  --topic __consumer_offsets \
  --formatter 'kafka.coordinator.group.GroupMetadataManager$OffsetsMessageFormatter' \
  --from-beginning
Output
[orders-service,orders,0]::OffsetAndMetadata(offset=182034, ...)

Compaction keeps only the latest offset per group and partition.
Advertisement

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11