Kafka Exception GroupMaxSizeReachedException
org.apache.kafka.common.errors.GroupMaxSizeReachedException
Non-retriable
Consumer
Indicates that a group is already at its configured maximum capacity and cannot accommodate more members
Common Causes
- Consumer group has more active members than the configured limit for that protocol (`group.max.size` for classic groups, or `group.consumer.max.size` for consumer-protocol groups)
- Rolling restart or deployment added new consumer instances before old ones left, temporarily exceeding the limit
- Multiple consumer group instances sharing the same group.id across different services or environments
Solutions
- Increase the applicable broker limit for the protocol in use (`group.max.size` for classic groups or `group.consumer.max.size` for consumer-protocol groups), or reduce the number of consumer instances to stay within the current limit
- Ensure old consumer instances are fully shut down before deploying new ones; use graceful shutdown with consumer.close() to trigger a leave-group before adding replacements
- Audit group membership with kafka-consumer-groups.sh --describe and kill stale/orphaned members that are not processing
Example Stack Trace
org.apache.kafka.common.errors.GroupMaxSizeReachedException: The group has reached its maximum size.Diagnostic Commands
# Describe consumer group offsets and lag
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <group-id>
# Check consumer group max size settings
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-default --describe | grep -E 'group.max.size|group.consumer.max.size'Related
Protocol error: GROUP_MAX_SIZE_REACHED (code 81)
Related Consumer exceptions: CommitFailedException · CoordinatorLoadInProgressException · CoordinatorNotAvailableException · FencedInstanceIdException · FencedMemberEpochException · IllegalGenerationException · InvalidGroupIdException · InvalidOffsetException
Hitting
GroupMaxSizeReachedException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.