Search⌘ K

Producer

Explore the role of Kafka Producers in writing messages to topics. Understand the steps from creating ProduceRecord objects, serializing data, partitioning logic, to batching and sending messages to Kafka brokers. Gain practical knowledge of producer configurations and error handling during data transmission.

We'll cover the following...

Producers write messages to Kafka that can then be consumed by readers. We’ll take a detailed look at how messages get written to Kafka in this lesson.

Write workflow

The steps involved are:

  1. An object of class ProduceRecord is instantiated which must contain the intended topic of the message and the message itself, which is the value. The message key and partition can optionally be included.

  2. Next, the key and values to be sent over the network are serialized. At this point, a ...