Apache Kafka

In this tutorial, you will learn about the retryable and non-retryable exceptions in Apache Kafka. You’ll learn how to create your own custom exceptions and how to register then with Kafka’s DefaultErrorHandler object. To demonstrate how retryable and not retryable exceptions work, I will use the Kafka Consumer Spring Boot Microservice, which I created earlier.…

Read More Retryable and Not Retryable Exceptions in Apache Kafka

In this tutorial, you will learn how recover from deserialization errors gracefully in your Kafka Consumer Spring Boot Microservice. You’ll see how to use specific settings to ensure that a single problematic message doesn’t disrupt your message processing. By the end, your consumer will be able to skip over errors and continue processing subsequent messages…

Read More Kafka Consumer: Handle Deserialization Errors

In this tutorial, you will learn how to configure Kafka Producer retries using two distinct approaches: The first approach utilizes the spring.kafka.producer.retries and spring.kafka.producer.properties.retry.backoff.ms configuration properties to define the number of retry attempts and the delay between them. The second approach involves the spring.kafka.producer.properties.linger.ms and spring.kafka.producer.properties.request.timeout.ms properties to manage the batching time and response timeout…

Read More Kafka Producer Retries in Spring Boot Microservice

In this tutorial, I will guide you through the process of setting up a Kafka Consumer using the @Configuration class and the @Bean method. This approach offers more flexibility and control compared to using the application.properties file. Kafka consumer configuration can be achieved in two primary ways in a Spring Boot application: Using the application.properties…

Read More Kafka Consumer Configuration in the @Bean Method

In this tutorial, I will guide you through setting up a Kafka Consumer in a Spring Boot application. You will learn how to configure the consumer properties, create a listener class using the @KafkaListener annotation, and how to process messages with the @KafkaHandler annotation. Let’s start with the configuration. Kafka Consumer Configuration in application.properties In…

Read More Creating Kafka Consumer in Spring Boot Microservice

When you send out messages in Kafka, it’s essential to know they’ve been received and saved properly. That’s where two important settings come in: spring.kafka.producer.acks and min.insync.replicas. These settings help ensure that your messages are safely stored and acknowledged by the Kafka brokers. In this tutorial, I’ll explain what these settings are, how to configure…

Read More Kafka Producer Acknowledgments in Spring Boot Microservice

In Apache Kafka, the min.insync.replicas configuration plays a crucial role in ensuring data durability and resilience. This setting determines the minimum number of replica copies (or in-sync replicas) that must acknowledge the receipt of a record before the producer can consider the write operation successful. Let’s break this down: Replicas: Think of these as backup…

Read More Kafka’s min.insync.replicas: Avoiding Data Loss

In this tutorial, you will learn how to start Apache Kafka Server with KRaft, a new consensus protocol that replaces ZooKeeper for metadata management. KRaft simplifies Kafka’s architecture and improves its performance and stability. You can read more about KRaft here and here. Step 1: Generate a Cluster UUID Before you can start Apache Kafka server on your…

Read More How to Start Apache Kafka Server with KRaft

In this guide, you will learn more about Kafka Topic, the core structure for data within Kafka. You will learn how to create, manage, and utilize Kafka Topics effectively. Each step includes practical examples and straightforward explanations, ensuring a clear understanding. As you progress, you’ll gain essential skills and knowledge, focusing solely on Kafka Topics.…

Read More Apache Kafka Topic: A Comprehensive Guide