Chapter 3: Kafka Producers: Writing Messages to Kafka
How producers write to Kafka: sending records, configuring acknowledgments and retries, serializing with Avro and a schema registry, and partitioning.
Read it alongside Chapter 3 of Kafka: The Definitive Guide, free from Confluent.
-
Figure 3-1
Kafka producer components
Follow one record through the producer, and see what happens when the broker accepts it, when the error is retriable, and when it is not.
-
Companion extra
What acks buys you
See the trade the acks setting makes: waiting costs latency, and not waiting costs a guarantee.
-
Figure 3-2
Serialization and deserialization of Avro records
See why an Avro message travelling through Kafka carries a schema ID instead of the schema itself.
-
Companion extra
The Avro wire format and the schema cache
See what the five bytes in front of every Avro record buy, and why the registry is asked once per schema rather than once per message.
-
Companion extra
Avro schema evolution through the registry
See why a reader and a writer never have to agree on a schema version, as long as the change keeps its defaults.