This chapter covers
- Connecting to Kafka
- Configuring client applications
- Sending messages using Kafka
- Typical challenges faced by producer applications
Let’s shift from the broker internals to how clients talk to Kafka. Client configurations play a significant role in the data-transfer process to and from brokers, so we need to look at the options available to optimize application performance and reliability. First we want to understand the basics of producers: configuring clients, connecting to Kafka, and choosing serializers. Then we can focus on how messages are sent and confirmed, including partitioning, acknowledgments, batching, timeouts, and timestamps. Along the way, we’ll note some common pitfalls and how to avoid them. The goal here is to help you send data to Kafka reliably and efficiently, with settings you can justify in production. Then, in the next chapter, we’ll examine the intricacies of developing consumer applications.