Lab 11: Kafka Java Client
Overview
Step 1: Kafka Architecture Review
Kafka Cluster:
┌──────────────────────────────────────────────────┐
│ Broker 1 Broker 2 Broker 3 │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Topic-A │ │ Topic-A │ │ Topic-A │ │
│ │ Part 0 │ │ Part 1 │ │ Part 2 │ │
│ │(leader) │ │(leader) │ │(leader) │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────────────────────────────────┘
│ │ │
Producer sends to leader of each partition
Consumer group: each partition → one consumer in group
Key concepts:
Offset: position within a partition (monotonically increasing)
Partition: ordered, immutable sequence of records
Consumer group: multiple consumers sharing topic partitions
Log compaction: retain latest record per key
ISR: in-sync replicas (for durability guarantees)Step 2: KafkaProducer Configuration
Step 3: Producer Send Patterns
Step 4: KafkaConsumer Configuration
Step 5: Consumer with Manual Offset Management
Step 6: Consumer Group Rebalancing
Step 7: Avro Schema and Exactly-Once Concepts
Step 8: Capstone — Kafka Client API Compilation
Summary
Concept
Config Key
Purpose
Last updated
