Mastering Kafka
Run Kafka, produce and consume messages reliably, and build a small event pipeline you can explain in an interview.
6 trail maps · 12 articles · 44 min reading, plus a task to try in each article
Last verified
Start the trail
First up: Send your first message, 4 min
Before you start
- Use a terminal. Run a command, read its output and stop it with Ctrl+C.
- Install Docker.(opens in a new tab) Every article runs Kafka in a container, so nothing else needs installing.
- Write a short Python script.(opens in a new tab) You need this from Send messages from code onwards.
Trail maps
- Messaging basics 3 articles
Run a broker, send a message and read it back.
- Producing and consuming 3 articles
Control where messages land, then send and read them from code.
- Consumer groups 2 articles
Share work across consumers and control when progress is saved.
- Operating a cluster 2 articles
Keep data safe and spot consumers that fall behind.
- Stream processing 1 article
Turn one stream of events into another as they arrive.
- Proof project 1 article
Put the trail together and prove you reached the destination.
- Article 1: Send your first message4 min. Part of Messaging basics. Start here. Done.
- Article 2: Split a topic into partitions3 min. Part of Messaging basics. Done. Learn first: Send your first message.
- Article 3: Read from an offset2 min. Part of Messaging basics. Done. Learn first: Send your first message.
- Article 4: Keep related messages in order4 min. Part of Producing and consuming. Done. Learn first: Split a topic into partitions.
- Article 5: Send messages from code4 min. Part of Producing and consuming. Done. Learn first: Keep related messages in order.
- Article 6: Read messages from code6 min. Part of Producing and consuming. Done. Learn first: Read from an offset, Send messages from code.
- Article 7: Share work with a consumer group3 min. Part of Consumer groups. Done. Learn first: Split a topic into partitions, Read from an offset.
- Article 8: Commit offsets yourself4 min. Part of Consumer groups. Done. Learn first: Read messages from code, Share work with a consumer group.
- Article 9: Keep data safe with replication3 min. Part of Operating a cluster. Done. Learn first: Split a topic into partitions.
- Article 10: Watch consumer lag3 min. Part of Operating a cluster. Done. Learn first: Commit offsets yourself.
- Article 11: Transform a stream4 min. Part of Stream processing. Done. Learn first: Send messages from code, Commit offsets yourself.
- Article 12: Build an order pipeline4 min. Part of Proof project. Done. Learn first: Keep data safe with replication, Watch consumer lag, Transform a stream.
Messaging basics
Producing and consuming
- Article 4: Keep related messages in order4 min · Learn first: 2 Done. (Split a topic into partitions)
- Article 5: Send messages from code4 min · Learn first: 4 Done. (Keep related messages in order)
- Article 6: Read messages from code6 min · Learn first: 3, 5 Done. (Read from an offset, Send messages from code)
Consumer groups
Operating a cluster
Stream processing
Proof project
After this trail
- Kafka Connect(opens in a new tab) Move data between Kafka and databases without writing a consumer.
- Kafka Streams(opens in a new tab) Joins, windows and exactly once processing, handled for you in Java.
- Message schemas Agree on message formats across teams with Avro or Protobuf and a schema registry.