This guide provides a comprehensive reference for Kafka consumer configuration properties, organized by functional area with production recommendations.
Category Purpose Connection Broker connectivity and identification Session Management Consumer group coordination and heartbeats Fetch Message retrieval behavior Offset Offset management and commit behavior Deserialization Message decoding Security Authentication and encryption
Property Description Example bootstrap.serversInitial broker addresses kafka-1:9092,kafka-2:9092key.deserializerKey deserializer class StringDeserializervalue.deserializerValue deserializer class StringDeserializer
Property Default Description group.id- Consumer group identifier. Required for group consumption. client.id- Logical identifier for monitoring and logging. group.instance.id- Static membership identifier (Kafka 2.3+). Reduces rebalances on restarts within session timeout. client.rack- Rack identifier for follower fetching (requires broker replica.selector.class).
# Basic connection configuration
bootstrap.servers =kafka-1:9092,kafka-2:9092,kafka-3:9092
group.id =order-processors
client.id =order-consumer-1
# Static membership for stable deployments
group.instance.id =order-consumer-pod-1
Session management controls consumer liveness detection and rebalance behavior.
Property Default Description session.timeout.ms45000 Time before consumer considered dead heartbeat.interval.ms3000 Frequency of heartbeat to coordinator max.poll.interval.ms300000 Maximum time between poll() calls
Relationship between heartbeat interval, session timeout, and max poll interval Relationship between heartbeat interval, session timeout, and max poll interval heartbeat.interval.ms 3s (default) session.timeout.ms 45s (default) max.poll.interval.ms 300s (default) Heartbeat frequency to coordinator Time before consumer considered dead Max time between poll() calls 1/3 of
heartbeat.interval.ms =3000
# Relationship requirements:
# heartbeat.interval.ms < session.timeout.ms / 3
# This allows 3 missed heartbeats before timeout
Scenario session.timeout.ms heartbeat.interval.ms max.poll.interval.ms Low latency 10000 3000 30000 Standard 45000 15000 300000 Slow processing 60000 15000 600000 Batch processing 120000 30000 1800000
Example starting points; tune based on processing time and SLA.
Processing Time Considerations
If message processing takes longer than max.poll.interval.ms, the consumer is removed from the group. Either increase this timeout or process messages asynchronously.
Fetch configuration controls how the consumer retrieves messages from brokers.
Property Default Description fetch.min.bytes1 Minimum data per fetch response fetch.max.bytes52428800 Maximum data per fetch response max.partition.fetch.bytes1048576 Maximum data per partition per fetch fetch.max.wait.ms500 Maximum wait for fetch.min.bytes
Property Default Description max.poll.records500 Maximum records per poll() call
# High throughput configuration
max.partition.fetch.bytes =4194304
# Low latency configuration
max.partition.fetch.bytes =1048576
Tuning Goal fetch.min.bytes fetch.max.wait.ms max.poll.records Low latency 1 100 100 Balanced 1024 500 500 High throughput 65536 1000 1000
Example starting points; tune based on payload size and latency targets.
Offset configuration controls how the consumer tracks and commits progress.
Property Default Description enable.auto.committrue Automatically commit offsets auto.commit.interval.ms5000 Frequency of auto-commits auto.offset.resetlatest Behavior when no committed offset exists
# Auto-commit enabled (at-least-once by default)
auto.commit.interval.ms =5000
# Manual commit for precise control
Value Behavior Use Case earliestStart from oldest message Reprocessing, new consumer groups latestStart from newest message Real-time processing, skip history noneThrow exception Strict offset requirement
# New consumer groups start from beginning
auto.offset.reset =earliest
# New consumer groups skip existing messages
# Fail if no offset exists
Property Default Description partition.assignment.strategyRangeAssignor Partition assignment algorithm
Strategy Class Description Range RangeAssignorConsecutive partitions per topic RoundRobin RoundRobinAssignorEven distribution across consumers Sticky StickyAssignorMinimizes partition movement CooperativeSticky CooperativeStickyAssignorIncremental rebalancing (recommended)
# Production recommendation: Cooperative sticky assignment
partition.assignment.strategy =org.apache.kafka.clients.consumer.CooperativeStickyAssignor
# Multiple strategies (fallback)
partition.assignment.strategy =org.apache.kafka.clients.consumer.CooperativeStickyAssignor,org.apache.kafka.clients.consumer.RangeAssignor
For transactional producers, consumers must choose their isolation level.
Property Default Description isolation.levelread_uncommitted Transaction visibility
Value Behavior read_uncommittedRead all messages including uncommitted transactions read_committedOnly read committed transaction messages
# For exactly-once consumers
isolation.level =read_committed
Property Default Description connections.max.idle.ms540000 Close idle connections after this time reconnect.backoff.ms50 Initial backoff for reconnection reconnect.backoff.max.ms1000 Maximum reconnection backoff request.timeout.ms30000 Timeout for network requests default.api.timeout.ms60000 Timeout for consumer API calls socket.receive.buffer.bytes65536 Socket receive buffer
# Network tuning for high-latency environments
default.api.timeout.ms =120000
connections.max.idle.ms =300000
Property Default Description exclude.internal.topicstrue Exclude internal topics from subscription patterns allow.auto.create.topicstrue Allow automatic topic creation
Property Default Description interceptor.classes- Consumer interceptor classes
// Custom interceptor for monitoring
public class MetricsInterceptor implements ConsumerInterceptor < String , String > {
public ConsumerRecords < String , String > onConsume ( ConsumerRecords < String , String > records ) {
metrics . recordConsumed ( records . count ()) ;
public void onCommit ( Map < TopicPartition , OffsetAndMetadata > offsets ) {
metrics . recordCommit ( offsets ) ;
interceptor.classes =com.example.MetricsInterceptor
security.protocol =SASL_SSL
sasl.jaas.config =org.apache.kafka.common.security.plain.PlainLoginModule required \
security.protocol =SASL_SSL
sasl.mechanism =SCRAM-SHA-256
sasl.jaas.config =org.apache.kafka.common.security.scram.ScramLoginModule required \
ssl.truststore.location =/path/to/truststore.jks
ssl.truststore.password =truststore-password
ssl.keystore.location =/path/to/keystore.jks
ssl.keystore.password =keystore-password
ssl.key.password =key-password
Example profile; adjust to your workload.
bootstrap.servers =kafka-1:9092,kafka-2:9092,kafka-3:9092
group.id =order-processors
client.id =order-consumer-1
heartbeat.interval.ms =15000
max.poll.interval.ms =300000
auto.offset.reset =earliest
partition.assignment.strategy =org.apache.kafka.clients.consumer.CooperativeStickyAssignor
key.deserializer =org.apache.kafka.common.serialization.StringDeserializer
value.deserializer =org.apache.kafka.common.serialization.StringDeserializer
Example profile; adjust to your workload.
bootstrap.servers =kafka-1:9092,kafka-2:9092,kafka-3:9092
group.id =high-throughput-processors
# Session - allow longer processing
heartbeat.interval.ms =15000
max.poll.interval.ms =600000
fetch.max.bytes =104857600
max.partition.fetch.bytes =10485760
auto.offset.reset =earliest
partition.assignment.strategy =org.apache.kafka.clients.consumer.CooperativeStickyAssignor
Example profile; adjust to your workload.
bootstrap.servers =kafka-1:9092,kafka-2:9092,kafka-3:9092
group.id =low-latency-processors
# Session - faster detection
heartbeat.interval.ms =3000
max.poll.interval.ms =30000
# Fetch - immediate delivery
partition.assignment.strategy =org.apache.kafka.clients.consumer.CooperativeStickyAssignor