<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Learning Kafka: Week 1 of 14-Day Journey]]></title><description><![CDATA[Learning Kafka: Week 1 of 14-Day Journey]]></description><link>https://apachekafkain14days.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Nov 2026 21:48:37 GMT</lastBuildDate><atom:link href="https://apachekafkain14days.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Learning Kafka: Week 1 of 14-Day Journey With Shubham Gore]]></title><description><![CDATA[Discover the fundamentals of Apache Kafka in this week 1 recap. Learn about Kafka's key components, setup, message production, and consumption. Explore…]]></description><link>https://apachekafkain14days.hashnode.dev/learning-kafka-week-1-of-14-day-journey-with-shubham-gore</link><guid isPermaLink="true">https://apachekafkain14days.hashnode.dev/learning-kafka-week-1-of-14-day-journey-with-shubham-gore</guid><category><![CDATA[kafka]]></category><category><![CDATA[apache]]></category><category><![CDATA[Apache Kafka]]></category><category><![CDATA[kafka topic]]></category><category><![CDATA[kafka broker]]></category><category><![CDATA[Kafka streams]]></category><category><![CDATA[kafka connect]]></category><category><![CDATA[Learning Journey]]></category><category><![CDATA[learning]]></category><category><![CDATA[#learning-in-public]]></category><category><![CDATA[Java]]></category><category><![CDATA[remote]]></category><dc:creator><![CDATA[Shubham Gore]]></dc:creator><pubDate>Sun, 01 Dec 2024 15:40:48 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-topics"><strong><em>Topics</em></strong></h3>
<ul>
<li><p><strong>What is Kafka?</strong>: Apache Kafka is a distributed streaming platform that allows for publishing, subscribing to, storing, and processing streams of records in real-time. It's designed to handle high-throughput, fault-tolerant, and scalable data pipelines.</p>
</li>
<li><p><strong>Why use Kafka?</strong>: It's perfect for real-time analytics, log aggregation, and message queuing.</p>
</li>
<li><p><strong>Key Use Cases</strong>:</p>
<ul>
<li><p>Real-time data pipelines.</p>
</li>
<li><p>Log aggregation systems.</p>
</li>
<li><p>Microservices communication.</p>
</li>
</ul>
</li>
<li><p><strong>Core Components</strong>:</p>
<ul>
<li><p><strong>Brokers</strong>: A broker is a Kafka server that runs in a Kafka cluster. It receives messages from producers, assigns offsets to them, and commits the messages to storage on disk. It also services consumers, responding to fetch requests for partitions and responding with the messages that have been published.</p>
</li>
<li><p><strong>Partition</strong>: A partition is an ordered, immutable sequence of records that is continually appended to. Each partition is a structured commit log, and records in the partitions are each assigned a sequential id number called the offset. Partitions allow Kafka to scale horizontally and provide parallel processing capabilities.</p>
</li>
<li><p><strong>Producers/Consumers</strong>: Handle message input and output.</p>
</li>
<li><p><strong>Replication</strong>: Kafka replicates data by maintaining multiple copies of each partition across different brokers. One broker is designated as the leader for a partition, handling all read and write requests, while others are followers that replicate the leader's data. If a leader fails, one of the followers becomes the new leader. The number of replicas is configurable per topic.</p>
</li>
</ul>
</li>
<li><p><strong>Message Delivery Guarantees</strong>:</p>
<ul>
<li><p>At-least-once.</p>
</li>
<li><p>At-most-once.</p>
</li>
<li><p>Exactly-once.</p>
</li>
</ul>
</li>
<li><p><strong>Producers</strong>:</p>
<ul>
<li>Control acknowledgement (acks), retries, and batching.</li>
</ul>
</li>
<li><p><strong>Consumers</strong>:</p>
<ul>
<li><p>Use consumer groups for scalability.</p>
</li>
<li><p>Manage offsets (auto or manual commit).</p>
</li>
</ul>
</li>
</ul>
<h3 id="heading-setup"><strong><em>Setup</em></strong></h3>
<ol>
<li><p>Downloaded Apache Kafka Binary from <a target="_blank" href="https://kafka.apache.org/downloads">Here</a>.</p>
</li>
<li><p>Extracted the file.</p>
</li>
<li><p>Started the Kafka broker and Zookeeper with following commands.</p>
<ul>
<li><pre><code class="lang-plaintext">    # Start Zookeeper
    bin/zookeeper-server-start.sh config/zookeeper.properties

    # Start Kafka broker
    bin/kafka-server-start.sh config/server.properties
</code></pre>
</li>
</ul>
</li>
<li><p>Created my first topic:</p>
<pre><code class="lang-plaintext">  bashCopy codebin/kafka-topics.sh --create --topic my-first-topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1
</code></pre>
</li>
<li><p>Produced messages using Kafka CLI:</p>
<pre><code class="lang-plaintext">  bashCopy codebin/kafka-console-producer.sh --topic my-first-topic --bootstrap-server localhost:9092
</code></pre>
</li>
<li><p>Consumed messages from the topic:</p>
<pre><code class="lang-plaintext">  bashCopy codebin/kafka-console-consumer.sh --topic my-first-topic --bootstrap-server localhost:9092 --from-beginning
</code></pre>
</li>
<li><p>Created a topic with multiple partitions:</p>
<pre><code class="lang-plaintext">  bashCopy codebin/kafka-topics.sh --create --topic multi-partition-topic --bootstrap-server localhost:9092 --partitions 3 --replication-factor 1
</code></pre>
</li>
<li><p>Produced messages and verified their partition distribution.</p>
</li>
<li><p>Observed partition behaviour using:</p>
<pre><code class="lang-plaintext"> bashCopy codebin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group console-consumer-group
</code></pre>
</li>
<li><p>wrote a simple Java producer to send messages.</p>
</li>
<li><p>Created a Java consumer to read messages and manually commit offsets.</p>
</li>
<li><p>check out the code on my <a target="_blank" href="https://github.com/shubhamagore/apache-kafka"><strong>GitHub</strong></a></p>
</li>
</ol>
<h3 id="heading-insights"><strong><em>Insights</em></strong></h3>
<ul>
<li><p>Kafka's CLI tools are intuitive for beginners.</p>
</li>
<li><p>Observing real-time message production and consumption was fascinating.</p>
</li>
<li><p>Partitioning improves scalability but requires careful design for ordering.</p>
</li>
<li><p>Consumer groups balance the load across consumers.</p>
</li>
<li><p>Managing offsets provides flexibility but requires careful implementation to avoid duplication.</p>
</li>
</ul>
<h3 id="heading-conclusion"><strong>Conclusion</strong></h3>
<p>This week, I explored the core concepts and practical aspects of Apache Kafka, focusing on topics like brokers, partitions, producers, consumers, and message delivery guarantees. Through hands-on exercises, I set up Kafka, created topics, and experimented with real-time message production and consumption.</p>
<p><strong>Key takeaways:</strong></p>
<ul>
<li><p><strong>Kafka's distributed architecture</strong> is powerful for handling large-scale, real-time data streams, with partitions ensuring scalability and fault tolerance.</p>
</li>
<li><p><strong>Partitioning</strong> enables parallel processing but also presents challenges around message ordering, which I had to consider when working with multiple partitions.</p>
</li>
<li><p><strong>Consumer groups</strong> offer a scalable approach to consuming messages, allowing multiple consumers to share the load, but offset management becomes crucial to avoid processing the same messages multiple times.</p>
</li>
<li><p><strong>Message delivery guarantees</strong> such as at-least-once, at-most-once, and exactly-once give flexibility in how Kafka handles message reliability and duplication.</p>
</li>
</ul>
<p>By setting up topics and consumers, observing partitioning behavior, and experimenting with Java producers and consumers, I gained a deeper understanding of Kafka's inner workings. Moving forward, I’ll continue to expand my knowledge on advanced features like Kafka Streams, Kafka Connect, and stream processing.</p>
<p>I am excited about what lies ahead in Week 2, as I dive deeper into Kafka's advanced topics and work on more sophisticated stream processing applications.</p>
<hr />
<h2 id="heading-engage-with-me"><strong>Engage with Me</strong></h2>
<ul>
<li><p><a target="_blank" href="https://x.com/ShubhamAGore"><strong>Twitter</strong></a>: Follow my daily updates and join the discussion!</p>
</li>
<li><p><a target="_blank" href="https://www.linkedin.com/in/shubham-gore-b02295230/"><strong>LinkedIn</strong></a>: Connect with me and share your Kafka journey.</p>
</li>
<li><p><strong>Hashnode</strong>: Stay updated with my weekly learning journals.</p>
</li>
</ul>
<p>Let me know your thoughts, questions, or feedback in the comments below. 🚀</p>
]]></content:encoded></item></channel></rss>