From the course: Apache Kafka Essential Training: Building Scalable Applications
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Producer publishing options - Kafka Tutorial
From the course: Apache Kafka Essential Training: Building Scalable Applications
Producer publishing options
- [Instructor] We will explore three producer publishing modes, and their are advantages and shortcomings in this videos. These three modes provide trade offs between scale, guaranteed delivery, and error handling. The first mode is the Synchronous Mode. In this case, the client code sends the message to the local producer. It then waits for the message to be actually sent to Kafka, and the acknowledgement received. The host thread is blocked until the acknowledgement is received. So if there are any errors in sending, the same thread can process the error before moving on to the next message. The call returns a record metadata object which contains information about the partition the message was published to, and the Kafka offset for the message in that partition. This method is simple and shows guaranteed message delivery, and has the ability to process errors in the same thread. The thread can also retry publishing the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.