Read time: ~

Cheat Sheet

Daily-use reference for producer, consumer, and broker configs, CLI one-liners, Spring Kafka keys, a delivery-semantics matrix, and links back to the deep-dive modules.

This page is the quick reference you keep open while working. It collects the settings and commands from across the course into scannable tables, with a deep-dive link on each topic so you can jump to the full explanation when you need the reasoning rather than just the value.


1. Producer configs

ConfigTypical valuePurpose
acksallDurability: wait for in-sync replicas
enable.idempotencetrueNo duplicates from producer retries
retries / delivery.timeout.mshigh / 120000Ride out transient failures
max.in.flight.requests.per.connection5 (with idempotence)Throughput without reordering
batch.size / linger.ms16384+ / 5-20Batching for throughput
compression.typelz4 / zstdShrink network and disk
max.request.size1048576Cap per-record size

Deep dive: Producing Deeper and Reliable Producing.


2. Consumer configs

ConfigTypical valuePurpose
group.idstable per serviceGroup membership and offset ownership
enable.auto.commitfalseCommit after processing, not before
auto.offset.resetearliest / latestBehavior with no committed offset
max.poll.records100-500Bound per-batch processing time
max.poll.interval.ms300000Max time between polls before eviction
session.timeout.ms / heartbeat.interval.ms45000 / 3000Liveness detection
group.instance.idper instanceStatic membership, fewer rebalances
fetch.min.bytes / fetch.max.wait.mstune / 500Throughput vs latency on fetch

Deep dive: Consuming Deeper and Rebalancing.


3. Broker and topic configs

ConfigTypical valuePurpose
replication.factor3AZ resilience
min.insync.replicas2Safe acks=all writes with RF 3
retention.ms / retention.bytesper topicHow long/large the log is kept
cleanup.policydelete / compactTime-based vs key-compacted
segment.bytes / segment.msdefaultsSegment rolling

Deep dive: Storage Internals and MSK Architecture.


4. CLI one-liners

# Topic layout, replicas, ISR
kafka-topics.sh --bootstrap-server $B --describe --topic orders

# Create a durable topic
kafka-topics.sh --bootstrap-server $B --create --topic orders \
  --partitions 3 --replication-factor 3

# Consumer group lag
kafka-consumer-groups.sh --bootstrap-server $B --describe --group payment-service

# Reset offsets (group stopped; ALWAYS dry-run first)
kafka-consumer-groups.sh --bootstrap-server $B --group payment-service \
  --topic orders --reset-offsets --to-earliest --dry-run

# Effective topic config
kafka-configs.sh --bootstrap-server $B --describe --entity-type topics --entity-name orders

# Change retention
kafka-configs.sh --bootstrap-server $B --alter --entity-type topics \
  --entity-name orders --add-config retention.ms=604800000

# Produce / consume by hand
kafka-console-producer.sh --bootstrap-server $B --topic orders
kafka-console-consumer.sh --bootstrap-server $B --topic orders --from-beginning \
  --property print.key=true

Deep dive: Tooling Walkthrough.


5. Spring Kafka config keys

spring:
  kafka:
    bootstrap-servers: ${KAFKA_BOOTSTRAP}
    producer:
      acks: all
      properties:
        enable.idempotence: true
    consumer:
      group-id: payment-service
      enable-auto-commit: false
      auto-offset-reset: earliest
      max-poll-records: 100
    listener:
      ack-mode: manual        # commit after processing
      concurrency: 3          # threads per listener
    properties:
      security.protocol: SASL_SSL   # on MSK

Deep dive: First Producer and Consumer.


6. Delivery-semantics matrix

SemanticProducerConsumerUse for
At most onceacks=0/1, no retriesCommit before processingDisposable data (metrics)
At least onceacks=all, retries, idempotenceCommit after processingMost business events (with idempotent consumer)
Exactly onceTransactions, acks=allisolation.level=read_committedRead-process-write within Kafka

Deep dive: Delivery Guarantees, Transactions and EOS, Idempotency and Ordering.


TopicModule
Core concepts, mental modelCore Concepts
Brokers, partitions, ISRCluster Anatomy
KRaft and ZooKeeperControl Plane
Local Docker labLocal Lab
Schema Registry, AvroSchema Registry
Retry, DLTRetry and Error Handling
Event-driven designEvent-Driven Architecture
Outbox, CDCOutbox and CDC
Kafka StreamsKafka Streams
Kafka ConnectKafka Connect
SecuritySecurity
ObservabilityObservability
PerformancePerformance Tuning
TestingTesting
Incident playbooksAlert Playbooks

Next:Capstone Project, where you build the whole system end to end.