group.id
session.timeout.ms
10
seconds for C/C++ and Java clients. You can increase this value to avoid excessive rebalancing due to poor network connectivity or long GC pauses. However, using a larger timeout means it will take longer for the coordinator to detect crashed consumers and reassign their partitions to other group members. For normal shutdowns, the consumer explicitly leaves the group, triggering an immediate rebalance.
heartbeat.interval.ms
3
seconds. For larger consumer groups, consider increasing this value to reduce coordinator load.
max.poll.interval.ms
Consume
method in .NET) before the consumer is considered failed. The default is 300
seconds and can be increased if your application needs more time to process messages. For Java consumers, you can also adjust max.poll.records
to control how many records are processed in each poll iteration.
enable.auto.commit
true
). When enabled, offsets are committed at the interval specified by auto.commit.interval.ms
, which defaults to 5
seconds. When disabled, you must manually commit offsets using commitSync()
or commitAsync()
.
auto.offset.reset
latest
(default): Start reading from the newest available messagesearliest
: Start reading from the beginning of the topicnone
: Throw an exception if no previous offset is foundpartition.assignment.strategy
PartitionAssignor
interface. Multiple strategies can be specified to support transitioning between strategies while maintaining compatibility with consumers using the previous strategy.
The following strategies are available:
org.apache.kafka.clients.consumer.RangeAssignor
org.apache.kafka.clients.consumer.RoundRobinAssignor
org.apache.kafka.clients.consumer.StickyAssignor
org.apache.kafka.clients.consumer.CooperativeStickyAssignor