- How to reset consumer group offsets to reprocess messages
- How to list and describe consumer groups and their state
- How to troubleshoot consumer lag and identify root causes
- How to delete consumer groups and manage offsets
How to reset a Kafka consumer group using the CLI?
To reset a Kafka consumer groups, we need to:- Find your broker hostname and port e.g.,
localhost:9092 - Understand the offset reset strategy (to earliest, to latest, to specific offset, shift by…)
- Stop the running consumer groups (otherwise the command will fail)
- Use the
kafka-consumer-groups.shCLI with the--reset-offsetsoption
Example: Reset offsets to the earliest
First, ensure that the consumers are stopped (“has no active members”)Example: Reset offsets shift by
Stop the running consumers to be able to reset offsets. Shift by allows you to rewind offsets by a specific value (negative to go back in messages and positive to advance in messages).-2 for the consumer group my-first-application subscribed on the topic first_topic
Gotchas
Here are the common mistakes and caveats with thekafka-consumer-groups.sh command:
- You cannot reset a consumer group if consumers are active in it.
- This command can be used to reprocess data for a consumer group (in case you have a bug fix)
- This command be also be used to advance message consumption in Kafka (for example if a message is a poison pill, or if your consumer is too slow to catch up with the entire topic).
Extra: Important options you can set (advanced)
--all-groups
Applies to all groups, use with caution
--all-topics
Consider all topics assigned to a group in the reset-offsets process, use with caution
--by-duration
Reset to offsets by duration
--dry-run
Only show the expected result, but does not actually run the command
--to-datetime, --by-period, --to-earliest, --to-latest, --shift-by, --from-file, --to-current
All the various options available to you to reset the offsets
How to list all Kafka consumers in a consumer groups using the CLI?
Listing all the Kafka consumer in a consumer group help you understand where the consumers are placed on your network, and how far they are into the topic consumption.CONSUMER ID represents the unique identifier of the consumer to the Kafka broker
The CLIENT ID represents a client-side setting that you can optionally set to identify a consumer in your consumer groups (with the client.id consumer property)
The CURRENT-OFFSET is the latest committed offset for that group
The LOG-END-OFFSET represents the latest message offset available in the topic-partition for consumption
The LAG is the difference of LOG-END-OFFSET and CURRENT-OFFSET and represents how far behind a consumer is to the tail of a topic.
The HOST is the hostname / IP of the consumer client machine.
How to list all Kafka consumers groups using the CLI?
Listing the consumer groups help you understand which ones could be down, or not stable. Listing consumer groups state--all-groups just specify the command for one group only.
How to delete a consumer group in Kafka using the CLI?
You may want to delete a consumer group in order to reset entirely the reading mechanism. For this, you can use thedelete option:
Troubleshoot consumer lag
Consumer lag occurs when consumers can’t keep up with the rate of incoming messages. Understanding and resolving lag is critical for maintaining real-time data processing.Understand LAG
LAG =LOG-END-OFFSET - CURRENT-OFFSET
- LAG = 0: Consumer is fully caught up
- LAG > 0 and stable: Consumer is behind but processing consistently
- LAG > 0 and growing: Consumer is falling further behind (problem!)
Consumer lag visualization
This diagram shows how lag accumulates when a consumer cannot keep up with the producer:
- Producer has written seven messages (offset 0-6, LOG-END-OFFSET is 7)
- Consumer has only processed three messages (CURRENT-OFFSET is 3)
- LAG of 4 means four unprocessed messages are waiting
- If LAG keeps growing, the consumer is too slow
Check consumer lag
- Partition 0: 1,000 messages behind
- Partition 1: 50 messages behind (acceptable)
- Partition 2: 4,100 messages behind (critical!)
Common causes and solutions
1. Slow message processing
Symptoms:- LAG increases steadily over time
- Consumer CPU usage is high
- Processing time per message is high
- Optimize consumer code (reduce processing time per message)
- Add more consumer instances (up to number of partitions)
- Increase consumer threads (
num.streamsin older API) - Use async processing where possible
2. Under-partitioned topic
Symptoms:- Maximum consumers reached but still have lag
- Cannot add more consumers to scale
- Single partition has very high lag
- Increase partition count (careful: can’t decrease later)
- Create new topic with more partitions and migrate
- Consider if messages can be processed in parallel
3. Consumer rebalancing
Symptoms:- Periodic spikes in lag
- LAG increases then decreases repeatedly
- Consumer logs show “Revoke” and “Assign” messages
- Use incremental cooperative rebalancing
- Increase
session.timeout.ms(default: 10s → 45s) - Increase
max.poll.interval.msif processing takes long - Enable static group membership for planned restarts
4. Network or broker issues
Symptoms:- Sudden spike in lag across all consumers
- Intermittent connection errors
- Broker CPU or disk I/O is saturated
- Check network connectivity between consumers and brokers
- Add more brokers if cluster is overloaded
- Optimize broker configuration (buffer sizes, threads)
- Check disk performance (especially if using spinning disks)
Troubleshoot with this decision tree

Best practices
Monitor lag continuously:- Set up alerts for LAG > threshold (e.g., 1000 messages)
- Track lag growth rate, not just absolute value
- Monitor per-partition lag, not just group average
- Start with enough partitions (2-3x expected consumers)
- Use incremental rebalancing to minimize disruption
- Optimize consumer processing before adding instances
- Test consumer performance under load before production
See it in practice with ConduktorConduktor Console provides real-time consumer lag monitoring with visual graphs, alerting thresholds, and historical trends. Identify lagging partitions at a glance and drill down to see consumer group details, rebalancing events, and processing rates.
Next steps
- Configure consumer group settings for optimal performance
- Understand incremental rebalancing to minimize disruption
- Learn about delivery semantics for reliable processing
- Explore consumer CLI basics for reading messages