Kafka Java Programming

Kafka Java Programming I’ve been learning Apache Kafka over the past week. I took the Udemy course Apache Kafka Series - Learn Apache Kafka for Beginners v3. I’m using this blog to take notes, and this post focuses specifically on Java programming with Kafka. Producer Basics To configure a Kafka producer: Set the key and value serializer to, for example, StringSerializer flush() the buffer close() the producer, which will flush the buffer automatically Callback Callbacks allow us to examine the state of a message. ...

July 19, 2025

Kafka CLI

Overview I’ve been learning Apache Kafka over the past week. I took the Udemy course Apache Kafka Series - Learn Apache Kafka for Beginners v3. I’m using this blog to take notes, and this post focuses specifically on Kafka CLI commands. Installation and Setup Client Installing the Kafka client on macOS is very straightforward: brew install kafka Homebrew will install both JDK and Kafka for you. You can verify the installation by running kafka-topics in your terminal. ...

July 16, 2025

Kafka Basics

Kafka Basics I’ve been learning Apache Kafka over the past week. I took the Udemy course Apache Kafka Series - Learn Apache Kafka for Beginners v3. This blog covers the theory part of Kafka. Topics, Partitions and Offsets Here are some important notes: Kafka is append-only Data retention policy (one week by default) Order is guaranteed only within a partition Producers When a key is null, data is sent to partitions in round-robin fashion When a key is specified, all messages for that key will always go to the same partition (using hashing). This is useful when you need message ordering. Messages ...

July 15, 2025