Kafka: Deleting a consumer group resets it completely

The group must have no active members, and afterwards it starts from auto.offset.reset.

Code
kafka-consumer-groups.sh --bootstrap-server localhost:9092 \
  --group orders-service --delete

# Or reset without deleting:
kafka-consumer-groups.sh --bootstrap-server localhost:9092 \
  --group orders-service --topic orders \
  --reset-offsets --to-earliest --execute
Output
Error: Group orders-service is not empty.
(stop the consumers first)
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