From the course: Apache Kafka Essential Training: Building Scalable Applications (2021)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Producer publishing options

Producer publishing options

From the course: Apache Kafka Essential Training: Building Scalable Applications (2021)

Start my 1-month free trial

Producer publishing options

- [Instructor] We will explore three producer publishing modes and their advantages and shortcomings in this video. These three modes provide trade-offs between skill, guaranteed delivery, and error handling. The first mode is called a 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 acknowledgment receive. The host thread is blocked until the acknowledgement is received. So if there are any errors in sending, the same threat can process the error before moving on to the next message. The call returns a RecordMetaData object which contains information about the partition the message was published to, and the Kafka offset for the message in that partition. This material has simple, ensures guaranteed message delivery, and has the ability to process errors in the same thread. The thread can either try republishing…

Contents