From the course: Complete Guide to Apache Kafka for Beginners

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Producers and message keys

Producers and message keys

Hi, this is Stephane from Conduktor. And in this lecture, we're going to learn about Producers. So we've seen that topics hold data, but for topics you have data written to it, well, we need to write a Kafka Producer. And so the Producers are going to write to the topic partitions. So remember we have partition 0 for my topic name, topic A, then partition 1, partition 2, and the writes happens sequentially with data offsets. And then your producer is right before that is going to send data into your Kafka topic partitions. So the producers know in advance to which partition they write to and then which Kafka broker, which is a Kafka server, has it. We'll learn about Kafka brokers very, very soon. So that means that the producers know in advance in which partition the message is going to be written. Some people think that Kafka decides at the end the server which partition the data gets written to. This is wrong. The producer decides in advance which partition to write to and we'll see…

Contents