<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hands-on Examples on Advanced Beginner</title><link>https://advanced-beginner.github.io/en/docs/kafka/examples/</link><description>Recent content in Hands-on Examples on Advanced Beginner</description><generator>Hugo</generator><language>en-US</language><managingEditor>d8lzz1gpw@mozmail.com (kimbenji)</managingEditor><webMaster>d8lzz1gpw@mozmail.com (kimbenji)</webMaster><lastBuildDate>Mon, 23 Mar 2026 19:08:15 +0900</lastBuildDate><atom:link href="https://advanced-beginner.github.io/en/docs/kafka/examples/index.xml" rel="self" type="application/rss+xml"/><item><title>Environment Setup</title><link>https://advanced-beginner.github.io/en/docs/kafka/examples/setup/</link><pubDate>Sat, 10 Jan 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kafka/examples/setup/</guid><description>&lt;p&gt;Reference guide for setting up Kafka with Spring Boot.&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Kafka Execution&lt;/strong&gt;: Run Kafka 3.6.1 in KRaft mode via Docker Compose&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dependencies&lt;/strong&gt;: Add &lt;code&gt;spring-kafka&lt;/code&gt;, &lt;code&gt;spring-boot-starter-web&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Basic Settings&lt;/strong&gt;: Configure &lt;code&gt;bootstrap-servers&lt;/code&gt;, Serializer/Deserializer, &lt;code&gt;group-id&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Production&lt;/strong&gt;: Ensure stability with &lt;code&gt;acks: all&lt;/code&gt;, &lt;code&gt;enable.idempotence: true&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;h4 id="target-audience-and-prerequisites"&gt;Target Audience and Prerequisites&lt;a class="anchor" href="#target-audience-and-prerequisites"&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Item&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Target Audience&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Developers setting up Kafka environment in Spring Boot projects&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Basic Docker usage, Gradle or Maven build tools, Spring Boot configuration files (application.yml)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Required Tools&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Docker Desktop or Docker Engine, JDK 17+, IDE (IntelliJ IDEA recommended)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Estimated Time&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;About 15 minutes&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If you completed Quick Start, you&amp;rsquo;ve already set up the basic environment. This document is a reference guide for configuration details and production environment setup.&lt;/p&gt;</description></item><item><title>Implementing Producer/Consumer with Spring Kafka</title><link>https://advanced-beginner.github.io/en/docs/kafka/examples/basic/</link><pubDate>Sat, 10 Jan 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kafka/examples/basic/</guid><description>&lt;p&gt;This document provides a step-by-step guide to sending and receiving messages using Spring Kafka.&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Producer&lt;/strong&gt;: Synchronous/asynchronous message sending with &lt;code&gt;KafkaTemplate&lt;/code&gt;, Partition assignment using Key&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consumer&lt;/strong&gt;: Message reception with &lt;code&gt;@KafkaListener&lt;/code&gt;, batch processing and pattern subscription support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Manual Commit&lt;/strong&gt;: Explicit commit after processing completion with &lt;code&gt;Acknowledgment&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;: Retry and Dead Letter Topic configuration with &lt;code&gt;@RetryableTopic&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;h2 id="before-you-begin"&gt;Before You Begin&lt;a class="anchor" href="#before-you-begin"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Item&lt;/th&gt;
 &lt;th&gt;Requirement&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Target Audience&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Backend developers who want to use Kafka in Spring Boot applications&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Basic Java syntax, Spring Boot fundamentals, Kafka basic concepts&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Prior Completion&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;&lt;a href="https://advanced-beginner.github.io/en/docs/kafka/quick-start/"&gt;Quick Start&lt;/a&gt; example completed, &lt;a href="https://advanced-beginner.github.io/en/docs/kafka/examples/setup/"&gt;Environment Setup&lt;/a&gt; configuration done&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Estimated Time&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;About 30 minutes&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;blockquote class="book-hint warning"&gt;&lt;strong&gt;Platform-specific Notes&lt;/strong&gt;&lt;br&gt;&lt;p&gt;&lt;strong&gt;Windows Users&lt;/strong&gt;: Use &lt;code&gt;gradlew.bat&lt;/code&gt; instead of &lt;code&gt;./gradlew&lt;/code&gt; in commands.&lt;/p&gt;</description></item><item><title>Order System</title><link>https://advanced-beginner.github.io/en/docs/kafka/examples/order-system/</link><pubDate>Sat, 10 Jan 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kafka/examples/order-system/</guid><description>&lt;p&gt;Implement an event-driven order system closer to real-world applications. In this example, we process the entire flow from order creation to delivery completion using Kafka events, and learn about order guarantee using Message Keys and extension patterns utilizing multiple Consumer Groups.&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Event-driven Architecture&lt;/strong&gt;: Convert REST API requests to Kafka events for asynchronous processing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Message Key&lt;/strong&gt;: Use orderId as Key to guarantee ordering of events for the same order&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;State Machine&lt;/strong&gt;: State transitions in order: CREATED -&amp;gt; PAID -&amp;gt; SHIPPED -&amp;gt; DELIVERED&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extension Pattern&lt;/strong&gt;: Multiple Consumer Groups independently subscribe to the same Topic&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;h4 id="target-audience-and-prerequisites"&gt;Target Audience and Prerequisites&lt;a class="anchor" href="#target-audience-and-prerequisites"&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Item&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Target Audience&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Backend developers looking to build event-driven systems&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Spring Boot fundamentals, Kafka basic concepts, &lt;a href="https://advanced-beginner.github.io/en/docs/kafka/examples/basic/"&gt;Basic Examples&lt;/a&gt; completed&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Required Environment&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Kafka running via Docker, JDK 17+, Gradle&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Estimated Time&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;About 45 minutes&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;All code examples on this page use the following common imports. The implementation centers around Spring Kafka&amp;rsquo;s KafkaTemplate and @KafkaListener, with JSON serialization handled through Jackson ObjectMapper.&lt;/p&gt;</description></item><item><title>Microservices Integration</title><link>https://advanced-beginner.github.io/en/docs/kafka/examples/microservices/</link><pubDate>Sat, 10 Jan 2026 00:00:00 +0000</pubDate><author>d8lzz1gpw@mozmail.com (kimbenji)</author><guid>https://advanced-beginner.github.io/en/docs/kafka/examples/microservices/</guid><description>&lt;p&gt;Implement event-driven communication using Kafka in a microservices environment.&lt;/p&gt;
&lt;blockquote class="book-hint info"&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Event Chaining&lt;/strong&gt;: Event propagation in order: Order -&amp;gt; Payment -&amp;gt; Shipment -&amp;gt; Notification&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Correlation ID&lt;/strong&gt;: Propagate correlation ID for distributed tracing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Saga Pattern&lt;/strong&gt;: Handle distributed transactions with compensation transactions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Idempotency&lt;/strong&gt;: Safely handle duplicate messages&lt;/li&gt;
&lt;/ul&gt;

&lt;/blockquote&gt;

&lt;h4 id="target-audience-and-prerequisites"&gt;Target Audience and Prerequisites&lt;a class="anchor" href="#target-audience-and-prerequisites"&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Item&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Target Audience&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Developers building event-driven communication in microservices architecture&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Kafka basics, Spring Boot, understanding of &lt;a href="https://advanced-beginner.github.io/en/docs/kafka/examples/order-system/"&gt;Order System&lt;/a&gt; example&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Required Environment&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;Docker, JDK 17+, environment capable of running multiple services&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;Estimated Time&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;About 60 minutes&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h4 id="scenario-order-processing-system"&gt;Scenario: Order Processing System&lt;a class="anchor" href="#scenario-order-processing-system"&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;In this example, the Order Service, Payment Service, Shipment Service, and Notification Service exchange events through Kafka. When the Order Service creates an order, it publishes an event to the orders Topic. The Payment Service receives this and processes payment, publishing results to the payments Topic. The Shipment Service receives payment completed events and creates shipments. The Notification Service subscribes to all Topics and sends notifications to customers.&lt;/p&gt;</description></item></channel></rss>