Introduction to Kafka with Spring Boot

Learn how to integrate with the Kafka messaging broker using Spring Boot 3 and Spring Kafka
Introduction to Kafka with Spring Boot
File Size :
3.43 GB
Total length :
5h 26m



John Thompson • 500,000+ Enrollments Worldwide


Last update




Introduction to Kafka with Spring Boot

What you’ll learn

Learn what Kafka is and how it works
How to install and run Kafka locally
Create a Spring Boot application that integrates with Kafka
Use Spring Kafka to consume and produce messages
Cover the important Spring and Spring Kafka annotations
Write Spring Boot integration tests with the embedded Kafka broker
Learn how to retry failed Kafka messages
Route messages that cannot be processed to dead letter topics
How to configure your Kafka Spring Beans
Serialize and deserialize messages in different formats, including Strings and JSON
How to use Wiremock to trigger failure scenarios that we can test
Learn all the core Kafka messaging concepts including messages, topics, partitions and keys
Use command line tools to send and receive messages and query the broker state
Learn about consumer groups, rebalancing, and consumer failover
Understand the role of consumer offsets
Learn the key differences between the main messaging brokers
Understand why Zookeeper is being replaced with KRaft

Introduction to Kafka with Spring Boot


Basic Java knowledge
Basic Spring knowledge


This course is for all things Kafka, Java, Spring and Spring Boot!This course will take you as a developer who knows just the basics on Spring Boot and Java to being able to develop a fully functional, fully tested, application that connects with the Kafka messaging broker in order to send and receive messages.In fact with our comprehensive code walkthroughs that start from scratch in writing our Spring Boot application you would be able to put together the application with no previous Spring Boot experience!This course has been developed by a team of highly experienced Java Software Engineers and Kafka consultants working closely with John Thompson, the Spring Framework Guru – we understand what a developer needs from such a course – it has been designed with the Java developer in mind to be able to gain the most from it.All the code that we walk through is available in the included git repositories for you to use as a starting point for your work, or for you to fork and extend as you begin to explore Kafka further.  Along the way there are assignments enabling you to put in practice what you have been learning, to build out a fully rounded microservices architecture.  We have accompanying articles on many of the Kafka concepts covered in the course – these go into greater depth providing you the opportunity to continue your learning and gain an advanced understanding on these areas.** What real Students are saying about this course **5 STARS – Fantastic course by Lydtech. I have learned Kafka and Spring boot from beginner to details.5 STARS – This is a great course. I like the challenging quizzes and assignments. It is very focus on the characteristics of topics. The instructors usually respond to questions very quickly.5 STARS – Very good course. I liked the structure a lot and how the topics build up on each other.5 STARS – This was a really nice course, with a perfect mix of theory, code-along sections and individual assignments. I really enjoyed it!5 STARS – Great introduction to Kafka Messaging, gives a lot of valuable insights and practical examples.5 STARS – The course introduction has been clear and focused. It has set a good foundation on what I can expect in the course.5 STARS – Great course to get introduced to Kafka with Spring boot. Loved that it reiterates on the concepts taught in the videos with quiz & hands-on exercises. I am pretty sure I will be revisiting the course again and will learn something new out of it.Inside this course you will learn about:Kafka Background and Concepts:The Kafka messaging brokerAll the key Kafka concepts including messages, keys, topics, partitions and offsetsThe need for asynchronous communicationComparison with other popular messaging brokersZookeeper vs KRaftConsumer groups and rebalancingMessage ordering with message keysInstalling and Running Kafka:Installing and running the broker locallyUsing the Kafka command line toolsSending and receiving messagesSpring Boot Application Development with Spring Kafka:Creating the Spring Boot application with Spring InitializrSpring Kafka APIsConsuming messages using the KafkaListener, KafkaListenerContainerFactory and ConsumerFactoryProducing messages using the KafkaTemplate and ProducerFactoryUtilising Spring Kafka annotations leaving Spring to do the heavy liftingUnit testing the Kafka consumer and producer with JUnit and MockitoIntegration testing with Spring Boot Test, Spring Kafka Test, and the embedded Kafka brokerSerializing and deserializing String and JSON messagesAvoiding poison pills with the correct error handlingConfiguring Kafka Spring Beans programmatically vs in the application propertiesManual and automatic topic creationConsumer group membership with shared vs duplicated message consumptionConsumer failover with multiple Spring Boot instancesSending and receiving message keysEnsuring related messages are orderedConsuming multiple event types from the same topicConfiguring trusted packagesRetrying failed messagesRouting messages to the dead letter topicUsing Wiremock to trigger error scenariosCourse Extra – IntelliJ IDEA UltimateStudents enrolling in the course can receive a free 4 month trial license to IntelliJ IDEA Ultimate! Get hands on experience using the Java IDE preferred by Spring Framework professionals!Course Extra – Access to a Private Slack CommunityYou’re not just enrolling in a course –> You are joining a community learning Spring.With your enrollment to the course, you can access an exclusive Slack community. Get help from the instructor and other Spring Framework Gurus from around the world – in real time! This community is only available to students enrolled in this course.This is a very active Slack community with over 18,700 Spring Framework Gurus!This is the largest online community of people learning Spring in the world.With your enrollment, you can join this community of awesome gurus!Closed Captioning / SubtitlesClosed captioning in English is available for all course videos!PDF DownloadsAll keynote presentations are available for you to download as PDFs.Lifetime AccessWhen you purchase this course, you will receive lifetime access! You can login anytime from anywhere to access the course content.No Risk – Money Back GuaranteeYou can buy this course with no risk. If you are unhappy with the course, for any reason, you can get a complete refund. The course has a 30 day Money Back Guarantee.


Section 1: Introduction

Lecture 1 Introduction

Lecture 2 Instructor Introduction

Lecture 3 Getting the Most out of this Course

Lecture 4 Is Your IDE Free Like a Puppy?

Lecture 5 Free 120 Day Trial for IntelliJ IDEA Ultimate

Lecture 6 Course Slack Channel

Lecture 7 Using GitHub

Section 2: Message Driven Architectures

Lecture 8 Message Driven Architectures

Lecture 9 Reactive Manifesto

Lecture 10 EIP

Section 3: Messaging with Kafka

Lecture 11 Section Introduction

Lecture 12 Synchronous & Asynchronous Communication

Lecture 13 Kafka vs ActiveMQ (JMS) vs Rabbit (AMQP)

Lecture 14 What is Kafka?

Lecture 15 Message vs Event

Lecture 16 What is a Kafka Message?

Lecture 17 KRaft & Zookeeper

Section 4: Installing and Running Kafka

Lecture 18 Section Introduction

Lecture 19 Install Kafka Locally, and Running the Broker

Lecture 20 Sending and Receiving

Lecture 21 CLI tools – Introduction

Lecture 22 CLI tools – Start / Stop Server Tool

Lecture 23 CLI tools – Topic Tool

Lecture 24 CLI tools – Consumer Group Tool

Lecture 25 Section Recap

Section 5: Coding Kafka with Spring Boot

Lecture 26 Section Introduction

Lecture 27 Creating The Project – Spring Initializr

Lecture 28 Lombok Annotations

Lecture 29 The Consumer

Lecture 30 JSON Deserializer

Lecture 31 Deserializer Error Handling

Lecture 32 Spring Bean Configuration

Lecture 33 Create The Topics

Lecture 34 Produce

Lecture 35 Consume Using CLI

Lecture 36 Section Recap

Section 6: Assignment – Tracking Service

Section 7: Spring Boot Integration Test

Lecture 37 Section Introduction

Lecture 38 Integration Test

Section 8: Multiple Instances & Consumer Groups

Lecture 39 Section Introduction

Lecture 40 Introduction to Consumer Group Exercises

Lecture 41 Shared Consumer Group

Lecture 42 Demo Consumer Failover

Lecture 43 Duplicate Consumption

Lecture 44 Section Recap

Section 9: Keys and Partitions

Lecture 45 Section Introduction

Lecture 46 Message Keys

Lecture 47 Consuming Keyed Messages

Lecture 48 Section Recap

Section 10: Consuming Multiple Event Types

Lecture 49 Section Introduction

Lecture 50 Kafka Handler

Lecture 51 Trusted Packages

Lecture 52 Section Recap

Section 11: Assignment: Multiple Event Types

Section 12: Error Handling, Retry, & Dead Letter Topics

Lecture 53 Section Introduction

Lecture 54 Wiremock Overview

Lecture 55 Retry: Introduction

Lecture 56 Retry: Coding

Lecture 57 Retry: Integration Tests

Lecture 58 Retry: Debugging Integration Tests

Lecture 59 Retry: Commandline Demo

Lecture 60 Retry: Recap

Lecture 61 Dead Letter Topics

Lecture 62 Section Recap

Section 13: Course Review

Lecture 63 Course Review

Lecture 64 Design Considerations

Lecture 65 Next Steps

Section 14: Appendix A – Using GitHub

Lecture 66 Git and GitHub Basics – Start Here!

This course is ideal for Java developers who wish to use Spring Boot to develop enterprise applications that use Kafka as the messaging broker for asynchronous event driven communication.

Course Information:

Udemy | English | 5h 26m | 3.43 GB
Created by: John Thompson • 500,000+ Enrollments Worldwide

You Can See More Courses in the Developer >> Greetings from

New Courses

Scroll to Top